|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.73 2002/08/05 02:30:50 tgl Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.74 2002/08/06 05:33:29 momjian Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -729,6 +729,27 @@ addRangeTableEntryForFunction(ParseState *pstate,
|
729 | 729 | */
|
730 | 730 | functyptype=get_typtype(funcrettype);
|
731 | 731 |
|
| 732 | +if (coldeflist!=NIL) |
| 733 | +{ |
| 734 | +/* |
| 735 | + * we *only* allow a coldeflist for functions returning a |
| 736 | + * RECORD pseudo-type |
| 737 | + */ |
| 738 | +if (functyptype!='p'|| (functyptype=='p'&&funcrettype!=RECORDOID)) |
| 739 | +elog(ERROR,"A column definition list is only allowed for" |
| 740 | +" functions returning RECORD"); |
| 741 | +} |
| 742 | +else |
| 743 | +{ |
| 744 | +/* |
| 745 | + * ... and a coldeflist is *required* for functions returning a |
| 746 | + * RECORD pseudo-type |
| 747 | + */ |
| 748 | +if (functyptype=='p'&&funcrettype==RECORDOID) |
| 749 | +elog(ERROR,"A column definition list is required for functions" |
| 750 | +" returning RECORD"); |
| 751 | +} |
| 752 | + |
732 | 753 | if (functyptype=='c')
|
733 | 754 | {
|
734 | 755 | /*
|
|