Commit 8d7c0851 authored by Tom Lane's avatar Tom Lane

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

or return type.
parent 6e646c73
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS. * ENHANCEMENTS, OR MODIFICATIONS.
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.16 2000/11/20 20:36:51 tgl Exp $ * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.17 2000/12/08 00:11:55 tgl Exp $
* *
**********************************************************************/ **********************************************************************/
...@@ -545,6 +545,10 @@ plperl_func_handler(PG_FUNCTION_ARGS) ...@@ -545,6 +545,10 @@ plperl_func_handler(PG_FUNCTION_ARGS)
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
if (!OidIsValid(procStruct->prorettype))
elog(ERROR, "plperl functions cannot return type \"opaque\""
"\n\texcept when used as triggers");
else
elog(ERROR, "plperl: cache lookup for return type %u failed", elog(ERROR, "plperl: cache lookup for return type %u failed",
procStruct->prorettype); procStruct->prorettype);
} }
...@@ -577,6 +581,9 @@ plperl_func_handler(PG_FUNCTION_ARGS) ...@@ -577,6 +581,9 @@ plperl_func_handler(PG_FUNCTION_ARGS)
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
if (!OidIsValid(procStruct->proargtypes[i]))
elog(ERROR, "plperl functions cannot take type \"opaque\"");
else
elog(ERROR, "plperl: cache lookup for argument type %u failed", elog(ERROR, "plperl: 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