summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2009-01-06 02:01:27 +0000
committerTom Lane2009-01-06 02:01:27 +0000
commitab5aad3c30585ae3ce773e989a85d38d9c50047a (patch)
treed080412a816dc0b1f2aae0e413f9d7075e39a774
parent5c0976a1d9fc391ef26aab5354191fa7fe8edd46 (diff)
Add some comments about why function parameter default expressions are
restricted.
-rw-r--r--src/backend/commands/functioncmds.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index 91a3cd8e73..c0542ef3d6 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -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,