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

Commit4f38b9a

Browse files
committed
Make CREATE CONVERSION verify that a putative encoding conversion function
returns VOID. This is the last of the easy fixes I recommended in11870.1218838360@sss.pgh.pa.us --- the others got done awhile ago butI forgot about this one.
1 parent1a0bbc2 commit4f38b9a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/backend/commands/conversioncmds.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/conversioncmds.c,v 1.35 2008/06/19 00:46:04 alvherre Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/conversioncmds.c,v 1.36 2008/11/14 17:40:56 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -82,6 +82,13 @@ CreateConversionCommand(CreateConversionStmt *stmt)
8282
funcoid=LookupFuncName(func_name,sizeof(funcargs) /sizeof(Oid),
8383
funcargs, false);
8484

85+
/* Check it returns VOID, else it's probably the wrong function */
86+
if (get_func_rettype(funcoid)!=VOIDOID)
87+
ereport(ERROR,
88+
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
89+
errmsg("encoding conversion function %s must return type \"void\"",
90+
NameListToString(func_name))));
91+
8592
/* Check we have EXECUTE rights for the function */
8693
aclresult=pg_proc_aclcheck(funcoid,GetUserId(),ACL_EXECUTE);
8794
if (aclresult!=ACLCHECK_OK)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp