summaryrefslogtreecommitdiff
path: root/contrib/tablefunc/tablefunc.c
diff options
context:
space:
mode:
authorTom Lane2003-05-16 06:07:51 +0000
committerTom Lane2003-05-16 06:07:51 +0000
commitbcfeca5856a9e631e283fba571469d2e5c5bee2c (patch)
treedb5950f473426330238cdd3bff28567cc7fc53f5 /contrib/tablefunc/tablefunc.c
parentc42581eba3c08ae7195472d32a39220697f72f58 (diff)
Check calling context for connectby_text(), per Joe Conway.
Diffstat (limited to 'contrib/tablefunc/tablefunc.c')
-rw-r--r--contrib/tablefunc/tablefunc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/tablefunc/tablefunc.c b/contrib/tablefunc/tablefunc.c
index 70df31d557f..984f31dc283 100644
--- a/contrib/tablefunc/tablefunc.c
+++ b/contrib/tablefunc/tablefunc.c
@@ -1048,6 +1048,11 @@ connectby_text(PG_FUNCTION_ARGS)
MemoryContext per_query_ctx;
MemoryContext oldcontext;
+ /* check to see if caller supports us returning a tuplestore */
+ if (!rsinfo || !(rsinfo->allowedModes & SFRM_Materialize))
+ elog(ERROR, "connectby: materialize mode required, but it is not "
+ "allowed in this context");
+
if (fcinfo->nargs == 6)
{
branch_delim = GET_STR(PG_GETARG_TEXT_P(5));