Joe Conway wrote:
> Tom Lane wrote:
>> Hm. I'd sort of expect the "z" to become both the table and column
>> alias in this case. What do you think?
>
> I guess that would make sense. I'll make a separate patch just for that
> change if that's OK.
>
Simple change -- patch attached.
test=# select * from myfoo1() as z;
z
----
1
2
3
(3 rows)
test=# select * from myfoo1();
myfoo1
--------
1
2
3
(3 rows)
test=# select * from myfoo1() as z(a);
a
----
1
2
3
(3 rows)
Joe
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 05:22:02 -0000
***************
*** 807,813 ****
elog(ERROR, "Too many column aliases specified for function %s",
funcname);
if (numaliases == 0)
! eref->colnames = makeList1(makeString(funcname));
}
else if (functyptype == 'p' && funcrettype == RECORDOID)
{
--- 807,813 ----
elog(ERROR, "Too many column aliases specified for function %s",
funcname);
if (numaliases == 0)
! eref->colnames = makeList1(makeString(eref->aliasname));
}
else if (functyptype == 'p' && funcrettype == RECORDOID)
{