From: Tom Lane Date: Fri, 16 May 2003 06:07:58 +0000 (+0000) Subject: Check calling context for connectby_text(), per Joe Conway. X-Git-Tag: REL7_3_3~14 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=ab90b49f6bd2ca40cf9bf8077760104a951674dc;p=users%2Fc2main%2Fpostgres.git Check calling context for connectby_text(), per Joe Conway. --- diff --git a/contrib/tablefunc/tablefunc.c b/contrib/tablefunc/tablefunc.c index d5db3ceed7..4fd3846820 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));