* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.24 2000/11/16 22:30:50 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.25 2000/12/08 00:03:02 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
if (!HeapTupleIsValid(typeTup))
{
plpgsql_comperrinfo();
- elog(ERROR, "cache lookup for return type %u failed",
- procStruct->prorettype);
+ if (!OidIsValid(procStruct->prorettype))
+ elog(ERROR, "plpgsql functions cannot return type \"opaque\""
+ "\n\texcept when used as triggers");
+ else
+ elog(ERROR, "cache lookup for return type %u failed",
+ procStruct->prorettype);
}
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
if (typeStruct->typrelid != InvalidOid)
if (!HeapTupleIsValid(typeTup))
{
plpgsql_comperrinfo();
- elog(ERROR, "cache lookup for argument type %u failed",
- procStruct->proargtypes[i]);
+ if (!OidIsValid(procStruct->proargtypes[i]))
+ elog(ERROR, "plpgsql functions cannot take type \"opaque\"");
+ else
+ elog(ERROR, "cache lookup for argument type %u failed",
+ procStruct->proargtypes[i]);
}
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
if (plpgsql_parse_wordrowtype(buf) != T_ROW)
{
plpgsql_comperrinfo();
- elog(ERROR, "cannot get tuple struct of argument %d", i + 1);
+ elog(ERROR, "cannot get tuple struct of argument %d",
+ i + 1);
}
row = plpgsql_yylval.row;