In fact, maybe a new option to set the OUT parameters prefix to use from within the function body would do?

Le 7 mars 09 à 19:56, Dimitri Fontaine a écrit :
CREATE OR REPLACE FUNCTION test_out
(
 IN  a integer,
 IN  b integer,
 OUT s integer
)
RETURNS setof integer

  SET out_prefix TO 'v_'

LANGUAGE PLPGSQL
AS $f$

Those two following lines would be deprecated:

DECLARE
 v_s ALIAS FOR $3;


BEGIN
 FOR v_s IN SELECT generate_series(a, b)
 LOOP
   v_s := v_s * v_s;
   RETURN NEXT;
 END LOOP;
 RETURN;
END;
$f$;

CREATE FUNCTION
dim=# SELECT * FROM test_out(2, 4);
s
----
 4
 9
16
(3 rows)

--
dim


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to