aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/functions.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-06-11 17:25:39 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-06-11 17:25:39 +0000
commit0c19f05803523eda14d0b5bc78bf82893fb64167 (patch)
treefea3e437e787ee8c7e518d725062d83e71cd6c1b /src/backend/executor/functions.c
parent772a074d4a89153231467cccd2e49400bbde9f6c (diff)
downloadpostgresql-0c19f05803523eda14d0b5bc78bf82893fb64167.tar.gz
postgresql-0c19f05803523eda14d0b5bc78bf82893fb64167.zip
Fix things so that you can still do "select foo()" where foo is a SQL
function returning setof record. This used to work, more or less accidentally, but I had broken it while extending the code to allow materialize-mode functions to be called in select lists. Add a regression test case so it doesn't get broken again. Per gripe from Greg Davidson.
Diffstat (limited to 'src/backend/executor/functions.c')
-rw-r--r--src/backend/executor/functions.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index b0d8b9008a8..fe25798a21e 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.134 2009/06/11 14:48:57 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.135 2009/06/11 17:25:38 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -634,11 +634,11 @@ fmgr_sql(PG_FUNCTION_ARGS)
* For simplicity, we require callers to support both set eval modes.
* There are cases where we must use one or must use the other, and
* it's not really worthwhile to postpone the check till we know.
+ * But note we do not require caller to provide an expectedDesc.
*/
if (!rsi || !IsA(rsi, ReturnSetInfo) ||
(rsi->allowedModes & SFRM_ValuePerCall) == 0 ||
- (rsi->allowedModes & SFRM_Materialize) == 0 ||
- rsi->expectedDesc == NULL)
+ (rsi->allowedModes & SFRM_Materialize) == 0)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("set-valued function called in context that cannot accept a set")));