Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite34ec13

Browse files
committed
Allow CALL with polymorphic type arguments
In order to be able to resolve polymorphic types, we need to set fn_exprbefore invoking the procedure.
1 parent0ce5cf2 commite34ec13

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

‎src/backend/commands/functioncmds.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,6 +2264,7 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver
22642264
/* Initialize function call structure */
22652265
InvokeFunctionExecuteHook(fexpr->funcid);
22662266
fmgr_info(fexpr->funcid,&flinfo);
2267+
fmgr_info_set_expr((Node*)fexpr,&flinfo);
22672268
InitFunctionCallInfoData(fcinfo,&flinfo,nargs,fexpr->inputcollid, (Node*)callcontext,NULL);
22682269

22692270
/*

‎src/test/regress/expected/create_procedure.out

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ SELECT * FROM cp_test;
116116
100 | Hello
117117
(8 rows)
118118

119+
-- polymorphic types
120+
CREATE PROCEDURE ptest6(a int, b anyelement)
121+
LANGUAGE SQL
122+
AS $$
123+
SELECT NULL::int;
124+
$$;
125+
CALL ptest6(1, 2);
119126
-- various error cases
120127
CALL version(); -- error: not a procedure
121128
ERROR: version() is not a procedure

‎src/test/regress/sql/create_procedure.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ CALL ptest5(b => 'Hello', a => 10);
8484
SELECT*FROM cp_test;
8585

8686

87+
-- polymorphic types
88+
89+
CREATE PROCEDURE ptest6(aint, b anyelement)
90+
LANGUAGE SQL
91+
AS $$
92+
SELECTNULL::int;
93+
$$;
94+
95+
CALL ptest6(1,2);
96+
97+
8798
-- various error cases
8899

89100
CALL version();-- error: not a procedure

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp