|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * 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 $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -82,6 +82,13 @@ CreateConversionCommand(CreateConversionStmt *stmt)
|
82 | 82 | funcoid=LookupFuncName(func_name,sizeof(funcargs) /sizeof(Oid),
|
83 | 83 | funcargs, false);
|
84 | 84 |
|
| 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 | + |
85 | 92 | /* Check we have EXECUTE rights for the function */
|
86 | 93 | aclresult=pg_proc_aclcheck(funcoid,GetUserId(),ACL_EXECUTE);
|
87 | 94 | if (aclresult!=ACLCHECK_OK)
|
|