Index: src/backend/parser/parse_relation.c =================================================================== RCS file: /opt/src/cvs/pgsql-server/src/backend/parser/parse_relation.c,v retrieving revision 1.73 diff -c -r1.73 parse_relation.c *** src/backend/parser/parse_relation.c 5 Aug 2002 02:30:50 -0000 1.73 --- src/backend/parser/parse_relation.c 5 Aug 2002 03:16:42 -0000 *************** *** 729,734 **** --- 729,755 ---- */ functyptype = get_typtype(funcrettype); + if (coldeflist != NIL) + { + /* + * we *only* allow a coldeflist for functions returning a + * RECORD pseudo-type + */ + if (functyptype != 'p' || (functyptype == 'p' && funcrettype != RECORDOID)) + elog(ERROR, "A column definition list is only allowed for" + " functions returning RECORD"); + } + else + { + /* + * ... and a coldeflist is *required* for functions returning a + * RECORD pseudo-type + */ + if (functyptype == 'p' && funcrettype == RECORDOID) + elog(ERROR, "A column definition list is required for functions" + " returning RECORD"); + } + if (functyptype == 'c') { /*