Skip to content

Commit 9f910a3

Browse files
committed
Add some comments about why function parameter default expressions are
restricted.
1 parent 10374a3 commit 9f910a3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/backend/commands/functioncmds.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.106 2009/01/01 17:23:38 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.107 2009/01/06 02:01:27 tgl Exp $
1414
*
1515
* DESCRIPTION
1616
* These routines take the parse tree and pick out the
@@ -311,7 +311,15 @@ examine_parameter_list(List *parameters, Oid languageOid,
311311
errmsg("cannot use table references in parameter default value")));
312312

313313
/*
314+
* It can't return a set either --- but coerce_to_specific_type
315+
* already checked that for us.
316+
*
314317
* No subplans or aggregates, either...
318+
*
319+
* Note: the point of these restrictions is to ensure that an
320+
* expression that, on its face, hasn't got subplans, aggregates,
321+
* etc cannot suddenly have them after function default arguments
322+
* are inserted.
315323
*/
316324
if (pstate->p_hasSubLinks)
317325
ereport(ERROR,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy