diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-12-08 00:09:07 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-12-08 00:09:07 +0000 |
commit | 6e646c73130c16570c72b704d73a59ffcff0b6cd (patch) | |
tree | 506f5087308945a26b897728db523c041aca439c | |
parent | 74c14995f1643119b4e338fb6d511420c12023cf (diff) | |
download | postgresql-6e646c73130c16570c72b704d73a59ffcff0b6cd.tar.gz postgresql-6e646c73130c16570c72b704d73a59ffcff0b6cd.zip |
Improve error message for erroneous use of 'opaque' as pltcl argument
or return type.
-rw-r--r-- | src/pl/tcl/pltcl.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c index 94a67ef0433..f37b31a30dd 100644 --- a/src/pl/tcl/pltcl.c +++ b/src/pl/tcl/pltcl.c @@ -31,7 +31,7 @@ * ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.30 2000/11/20 20:36:52 tgl Exp $ + * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.31 2000/12/08 00:09:07 tgl Exp $ * **********************************************************************/ @@ -489,8 +489,12 @@ pltcl_func_handler(PG_FUNCTION_ARGS) { free(prodesc->proname); free(prodesc); - elog(ERROR, "pltcl: cache lookup for return type %u failed", - procStruct->prorettype); + if (!OidIsValid(procStruct->prorettype)) + elog(ERROR, "pltcl functions cannot return type \"opaque\"" + "\n\texcept when used as triggers"); + else + elog(ERROR, "pltcl: cache lookup for return type %u failed", + procStruct->prorettype); } typeStruct = (Form_pg_type) GETSTRUCT(typeTup); @@ -521,8 +525,11 @@ pltcl_func_handler(PG_FUNCTION_ARGS) { free(prodesc->proname); free(prodesc); - elog(ERROR, "pltcl: cache lookup for argument type %u failed", - procStruct->proargtypes[i]); + if (!OidIsValid(procStruct->proargtypes[i])) + elog(ERROR, "pltcl functions cannot take type \"opaque\""); + else + elog(ERROR, "pltcl: cache lookup for argument type %u failed", + procStruct->proargtypes[i]); } typeStruct = (Form_pg_type) GETSTRUCT(typeTup); |