diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-01-06 02:01:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-01-06 02:01:27 +0000 |
commit | 9f910a3b9aeab5a79142860eea53747c1f321aa3 (patch) | |
tree | ebd8ead5804523633982843587937c6553b40ffa /src/backend/commands/functioncmds.c | |
parent | 10374a34c685db5b40b9a53313564b8934ef9ec8 (diff) | |
download | postgresql-9f910a3b9aeab5a79142860eea53747c1f321aa3.tar.gz postgresql-9f910a3b9aeab5a79142860eea53747c1f321aa3.zip |
Add some comments about why function parameter default expressions are
restricted.
Diffstat (limited to 'src/backend/commands/functioncmds.c')
-rw-r--r-- | src/backend/commands/functioncmds.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 91b65b3a58e..a813fd9a028 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.106 2009/01/01 17:23:38 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.107 2009/01/06 02:01:27 tgl Exp $ * * DESCRIPTION * These routines take the parse tree and pick out the @@ -311,7 +311,15 @@ examine_parameter_list(List *parameters, Oid languageOid, errmsg("cannot use table references in parameter default value"))); /* + * It can't return a set either --- but coerce_to_specific_type + * already checked that for us. + * * No subplans or aggregates, either... + * + * Note: the point of these restrictions is to ensure that an + * expression that, on its face, hasn't got subplans, aggregates, + * etc cannot suddenly have them after function default arguments + * are inserted. */ if (pstate->p_hasSubLinks) ereport(ERROR, |