Commit 6e646c73 authored by Tom Lane's avatar Tom Lane

Improve error message for erroneous use of 'opaque' as pltcl argument

or return type.
parent 74c14995
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* ENHANCEMENTS, OR MODIFICATIONS. * ENHANCEMENTS, OR MODIFICATIONS.
* *
* IDENTIFICATION * 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,6 +489,10 @@ pltcl_func_handler(PG_FUNCTION_ARGS) ...@@ -489,6 +489,10 @@ pltcl_func_handler(PG_FUNCTION_ARGS)
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
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", elog(ERROR, "pltcl: cache lookup for return type %u failed",
procStruct->prorettype); procStruct->prorettype);
} }
...@@ -521,6 +525,9 @@ pltcl_func_handler(PG_FUNCTION_ARGS) ...@@ -521,6 +525,9 @@ pltcl_func_handler(PG_FUNCTION_ARGS)
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
if (!OidIsValid(procStruct->proargtypes[i]))
elog(ERROR, "pltcl functions cannot take type \"opaque\"");
else
elog(ERROR, "pltcl: cache lookup for argument type %u failed", elog(ERROR, "pltcl: cache lookup for argument type %u failed",
procStruct->proargtypes[i]); procStruct->proargtypes[i]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment