33 * procedural language
44 *
55 * IDENTIFICATION
6- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.49 2002/08/30 00 :28:41 tgl Exp $
6+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.50 2002/09/01 16 :28:06 tgl Exp $
77 *
88 * This software is copyrighted by Jan Wieck - Hamburg.
99 *
@@ -211,11 +211,11 @@ plpgsql_compile(Oid fn_oid, int functype)
211211procStruct -> prorettype );
212212typeStruct = (Form_pg_type )GETSTRUCT (typeTup );
213213
214- /* Disallow pseudotype result, except VOID */
215- /* XXX someday allow RECORD? */
214+ /* Disallow pseudotype result, except VOID or RECORD */
216215if (typeStruct -> typtype == 'p' )
217216{
218- if (procStruct -> prorettype == VOIDOID )
217+ if (procStruct -> prorettype == VOIDOID ||
218+ procStruct -> prorettype == RECORDOID )
219219/* okay */ ;
220220else if (procStruct -> prorettype == TRIGGEROID ||
221221procStruct -> prorettype == OPAQUEOID )
@@ -227,7 +227,8 @@ plpgsql_compile(Oid fn_oid, int functype)
227227format_type_be (procStruct -> prorettype ));
228228}
229229
230- if (typeStruct -> typrelid != InvalidOid )
230+ if (typeStruct -> typrelid != InvalidOid ||
231+ procStruct -> prorettype == RECORDOID )
231232function -> fn_retistuple = true;
232233else
233234{
@@ -486,8 +487,7 @@ plpgsql_compile(Oid fn_oid, int functype)
486487}
487488
488489/*
489- * Create the magic found variable indicating if the last FOR or
490- * SELECT statement returned data
490+ * Create the magic FOUND variable.
491491 */
492492var = malloc (sizeof (PLpgSQL_var ));
493493memset (var ,0 ,sizeof (PLpgSQL_var ));