3
3
* procedural language
4
4
*
5
5
* IDENTIFICATION
6
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.24 2000/11/16 22:30:50 tgl Exp $
6
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.25 2000/12/08 00:03:02 tgl Exp $
7
7
*
8
8
* This software is copyrighted by Jan Wieck - Hamburg.
9
9
*
@@ -181,8 +181,12 @@ plpgsql_compile(Oid fn_oid, int functype)
181
181
if (!HeapTupleIsValid (typeTup ))
182
182
{
183
183
plpgsql_comperrinfo ();
184
- elog (ERROR , "cache lookup for return type %u failed" ,
185
- procStruct -> prorettype );
184
+ if (!OidIsValid (procStruct -> prorettype ))
185
+ elog (ERROR , "plpgsql functions cannot return type \"opaque\""
186
+ "\n\texcept when used as triggers" );
187
+ else
188
+ elog (ERROR , "cache lookup for return type %u failed" ,
189
+ procStruct -> prorettype );
186
190
}
187
191
typeStruct = (Form_pg_type ) GETSTRUCT (typeTup );
188
192
if (typeStruct -> typrelid != InvalidOid )
@@ -214,8 +218,11 @@ plpgsql_compile(Oid fn_oid, int functype)
214
218
if (!HeapTupleIsValid (typeTup ))
215
219
{
216
220
plpgsql_comperrinfo ();
217
- elog (ERROR , "cache lookup for argument type %u failed" ,
218
- procStruct -> proargtypes [i ]);
221
+ if (!OidIsValid (procStruct -> proargtypes [i ]))
222
+ elog (ERROR , "plpgsql functions cannot take type \"opaque\"" );
223
+ else
224
+ elog (ERROR , "cache lookup for argument type %u failed" ,
225
+ procStruct -> proargtypes [i ]);
219
226
}
220
227
typeStruct = (Form_pg_type ) GETSTRUCT (typeTup );
221
228
@@ -232,7 +239,8 @@ plpgsql_compile(Oid fn_oid, int functype)
232
239
if (plpgsql_parse_wordrowtype (buf ) != T_ROW )
233
240
{
234
241
plpgsql_comperrinfo ();
235
- elog (ERROR , "cannot get tuple struct of argument %d" , i + 1 );
242
+ elog (ERROR , "cannot get tuple struct of argument %d" ,
243
+ i + 1 );
236
244
}
237
245
238
246
row = plpgsql_yylval .row ;
0 commit comments