Allow plpgsql IN parameters to be assigned to. Since the parameters are just
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 Sep 2009 01:53:32 +0000 (01:53 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 Sep 2009 01:53:32 +0000 (01:53 +0000)
preinitialized local variables, this does not affect the function's semantics
as seen by callers; allowing assignment simply avoids the need to create more
local variables in some cases.  In any case we were being rather inconsistent
since only scalar parameters were getting marked constant.

No documentation change, since parameters were never documented as being
marked constant anyway.

Steve Prentice

src/pl/plpgsql/src/pl_comp.c

index 028013f860f531dcb76f8170a1fa4a63ac94a8d7..1bec949b8f3ddf487c23258adf4563fc7127a835 100644 (file)
@@ -424,10 +424,6 @@ do_compile(FunctionCallInfo fcinfo,
                                if (argvariable->dtype == PLPGSQL_DTYPE_VAR)
                                {
                                        argitemtype = PLPGSQL_NSTYPE_VAR;
-                                       /* input argument vars are forced to be CONSTANT */
-                                       if (argmode == PROARGMODE_IN ||
-                                               argmode == PROARGMODE_VARIADIC)
-                                               ((PLpgSQL_var *) argvariable)->isconst = true;
                                }
                                else
                                {