From: Tom Lane Date: Tue, 6 Jan 2009 02:01:27 +0000 (+0000) Subject: Add some comments about why function parameter default expressions are X-Git-Tag: recoveryinfrav9~126 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=ab5aad3c30585ae3ce773e989a85d38d9c50047a;p=users%2Fsimon%2Fpostgres.git Add some comments about why function parameter default expressions are restricted. --- 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,