Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]

From: Steve Prentice <prentice(at)cisco(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Abhijit Menon-Sen <ams(at)toroid(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]
Date: 2009-09-16 14:19:25
Message-ID: DD0FE1BA-CA3A-473F-A3FE-67244F6B3ABC@cisco.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sep 16, 2009, at 6:03 AM, Andrew Dunstan wrote:
> Abhijit Menon-Sen wrote:
>> At 2009-09-16 08:37:40 -0400, andrew(at)dunslane(dot)net wrote:
>>> How does this compare with PLSQL?
>>
>> I don't remember anything of PL/SQL myself, but Pavel Stehule had
>> this
>> to say in response to the original post:
>>
>>> This behave is in conflict with PL/SQL, what should do some
>>> problems.
>>> I thing, so I understand well, why this behave is in PL/SQL. It
>>> hasn't
>>> sense in plpgsql, because OUT and INOUT params has little bit
>>> different syntax (calling) and nobody will do similar bugs
>>> (perhaps).
>>> What is interesting - this behave is in conformity with SQL/PSM,
>>> where
>>> parameters are mutable too.
>>>
>>> I am for it. PL/pgSQL doesn't promise compatibility with PL/SQL and
>>> this change should to help some beginners (and this limit is
>>> artificial and unnecessary).
>>
>> Given the existing OUT/INOUT syntax difference as noted, I don't
>> think
>> the patch represents a significant problem.
>
> I'm not terribly impressed by either of Pavel's arguments. SQL/PSM
> is irrelevant, and the existence of one inconsistency doesn't seems
> to me to be a good rationale to create another. If there were a
> major increase in utility I would be more willing, but at best this
> overcomes a minor inconvenience, that is easily worked around.
>
> It probably won't cause any problem with code being migrated from
> PLSQL, but it will affect code going the other way. The question is:
> do we care about that? I'm prepared to be persuaded that we
> shouldn't care, but I'm not quite there yet.

My motivation for submitting the patch was that it makes porting a
huge collection of Informix SPL stored procedures easier. There are so
many differences between plpgsql and SPL that you would think this
wasn't that big of a deal, however, most of the other issues are
easily taken care of with a simple sed script or something slightly
more advanced (e.g. dealing with the declare/define block
differences). This is one of the few compatibility issues where you
really need to review and change lots of code by hand.

The patch doesn't break existing code and doesn't make it any harder
to port code from PL/SQL and on the flip side, this patch with the
named/mixed notation patch from Pavel makes porting from Informix's
SPL much easier.

Thanks for everyone's consideration.

-Steve

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-09-16 15:04:14 Re: WIP: generalized index constraints
Previous Message Pavel Stehule 2009-09-16 14:17:20 Re: PATCH: make plpgsql IN args mutable (v1) [REVIEW]