Re: RFD: Don't force plpgsql IN parameters to constant - Mailing list pgsql-hackers

From Albe Laurenz
Subject Re: RFD: Don't force plpgsql IN parameters to constant
Date
Msg-id D960CB61B694CF459DCFB4B0128514C203937E8B@exadv11.host.magwien.gv.at
Whole thread Raw
In response to Re: RFD: Don't force plpgsql IN parameters to constant  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
>>> Is there a reason we force plpgsql IN parameters to constant?
>
> Now having said all that, I'm not really in favor of Steve's
> proposal --- it seems like it mostly would be encouraging dubious
> programming practices.  But it's hard to say that the arguments
> against are more than theoretical/aesthetic ones.
>
> Does anyone happen to know how it works in Oracle's PL/SQL?
> I think that following their lead is usually the argument-settler
> when it comes to plpgsql behavior.

Oracle 10.2.0.4:

CREATE PROCEDURE test2(a NUMBER) AUTHID CURRENT_USER AS
BEGIN  a := 2;
END;
/

PLS-00363: expression 'A' cannot be used as an assignment target

So it does not work in Oracle.


The proposed feature would have come handy for me once or twice,
but maybe that is more a sign of my sloppy coding habits than
anything else ...

Still, +1 from me for the proposal.

In my experience, restrictive languages have never kept people
from writing bad and confusing code.

What about introducing a keyword CONSTANT in the parameter list
to force the old behaviour?
(This would remove us further from Oracle though.)

Yours,
Laurenz Albe


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Patch for 8.5, transformationHook
Next
From: Dean Rasheed
Date:
Subject: Re: WIP: Deferrable unique constraints