mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-14 18:37:03 +08:00
Support for OUT parameters in procedures
Unlike for functions, OUT parameters for procedures are part of the signature. Therefore, they have to be listed in pg_proc.proargtypes as well as mentioned in ALTER PROCEDURE and DROP PROCEDURE. Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com> Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/2b8490fe-51af-e671-c504-47359dc453c5@2ndquadrant.com
This commit is contained in:
@ -54,6 +54,25 @@ $$;
|
||||
CALL test_proc6(2, 3, 4);
|
||||
|
||||
|
||||
-- OUT parameters
|
||||
|
||||
CREATE PROCEDURE test_proc9(IN a int, OUT b int)
|
||||
LANGUAGE plpythonu
|
||||
AS $$
|
||||
plpy.notice("a: %s, b: %s" % (a, b))
|
||||
return (a * 2,)
|
||||
$$;
|
||||
|
||||
DO $$
|
||||
DECLARE _a int; _b int;
|
||||
BEGIN
|
||||
_a := 10; _b := 30;
|
||||
CALL test_proc9(_a, _b);
|
||||
RAISE NOTICE '_a: %, _b: %', _a, _b;
|
||||
END
|
||||
$$;
|
||||
|
||||
|
||||
DROP PROCEDURE test_proc1;
|
||||
DROP PROCEDURE test_proc2;
|
||||
DROP PROCEDURE test_proc3;
|
||||
|
||||
Reference in New Issue
Block a user