summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-05-16 06:07:58 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-05-16 06:07:58 +0000
commitab90b49f6bd2ca40cf9bf8077760104a951674dc (patch)
tree73dd4d445eb5b44f08d0b8de76d5a61a0f8eb1e6 /contrib
parent3ffaf20461e197e4b17f69e06df58e7469075021 (diff)
Check calling context for connectby_text(), per Joe Conway.
Diffstat (limited to 'contrib')
-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 d5db3ceed73..4fd3846820b 100644
--- a/contrib/tablefunc/tablefunc.c
+++ b/contrib/tablefunc/tablefunc.c
@@ -646,6 +646,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));