1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Support parameters in CALL

To support parameters in CALL, move the parse analysis of the procedure
and arguments into the global transformation phase, so that the parser
hooks can be applied.  And then at execution time pass the parameters
from ProcessUtility on to ExecuteCallStmt.
This commit is contained in:
Peter Eisentraut
2018-02-20 18:03:31 -05:00
parent a6a80134e3
commit 76b6aa41f4
11 changed files with 124 additions and 24 deletions

View File

@ -55,6 +55,22 @@ AS $$
SELECT 5;
$$;
CALL ptest2();
-- nested CALL
TRUNCATE cp_test;
CREATE PROCEDURE ptest3(y text)
LANGUAGE SQL
AS $$
CALL ptest1(y);
CALL ptest1($1);
$$;
CALL ptest3('b');
SELECT * FROM cp_test;
a | b
---+---
1 | b
1 | b
(2 rows)
-- various error cases
CALL version(); -- error: not a procedure
ERROR: version() is not a procedure

View File

@ -31,6 +31,21 @@ $$;
CALL ptest2();
-- nested CALL
TRUNCATE cp_test;
CREATE PROCEDURE ptest3(y text)
LANGUAGE SQL
AS $$
CALL ptest1(y);
CALL ptest1($1);
$$;
CALL ptest3('b');
SELECT * FROM cp_test;
-- various error cases
CALL version(); -- error: not a procedure