mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add procedure support to pg_get_functiondef
This also makes procedures work in psql's \ef and \sf commands. Reported-by: Pavel Stehule <pavel.stehule@gmail.com>
This commit is contained in:
@ -30,6 +30,17 @@ CALL ptest1(substring(random()::text, 1, 1)); -- ok, volatile arg
|
||||
public | ptest1 | | x text | proc
|
||||
(1 row)
|
||||
|
||||
SELECT pg_get_functiondef('ptest1'::regproc);
|
||||
pg_get_functiondef
|
||||
---------------------------------------------------
|
||||
CREATE OR REPLACE PROCEDURE public.ptest1(x text)+
|
||||
LANGUAGE sql +
|
||||
AS $procedure$ +
|
||||
INSERT INTO cp_test VALUES (1, x); +
|
||||
$procedure$ +
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT * FROM cp_test ORDER BY b COLLATE "C";
|
||||
a | b
|
||||
---+-------
|
||||
|
@ -17,6 +17,7 @@ CALL ptest1('xy' || 'zzy'); -- ok, constant-folded arg
|
||||
CALL ptest1(substring(random()::text, 1, 1)); -- ok, volatile arg
|
||||
|
||||
\df ptest1
|
||||
SELECT pg_get_functiondef('ptest1'::regproc);
|
||||
|
||||
SELECT * FROM cp_test ORDER BY b COLLATE "C";
|
||||
|
||||
|
Reference in New Issue
Block a user