Re: INOUT parameters in procedures - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: INOUT parameters in procedures
Date
Msg-id CAFj8pRAJAV_E6n-=+omAdX-TyqxZuhLxh3o-8rzQbP40iDwj8g@mail.gmail.com
Whole thread Raw
In response to Re: INOUT parameters in procedures  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: INOUT parameters in procedures  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers


2018-03-05 19:38 GMT+01:00 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>:
On 3/5/18 11:00, Pavel Stehule wrote:
> I am looking on attached code, and it looks pretty well. Can be really
> nice if this code will be part of release 11, because it is very
> interesting, important feature feature.

Here is an updated patch, rebased on top of several recent changes, also
added more documentation and tests in other PLs.

> p.s. can be nice, if we allow same trick with calling of OUT variables
> functions in plpgsql
>
> fx(in a, out x, out y) return int -- but requires some special mark
>
> do $$
> declare x int, y int, z int;
> begin
>   z := fx(10, x, y);
>   raise notice '% ....
>
> Then migration from Oracle can be really easy and friendly

This would require some changes to how routines are looked up, because
we currently ignore OUT parameters there.  That code does not exist yet.
 But it's certainly a plausible extension for the future.

sure - this is topic for 12 release. But it can fix more than one issue when PL/SQL code is migrated.

note: in this case we should to return one parameter more. Out parameters + RETURN expression result.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: INOUT parameters in procedures
Next
From: Heikki Linnakangas
Date:
Subject: Re: Optimize Arm64 crc32c implementation in Postgresql