Re: anonymous composite types for Table Functions (aka SRFs)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: anonymous composite types for Table Functions (aka SRFs)
Дата
Msg-id 20322.1028554630@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: anonymous composite types for Table Functions (aka  (Joe Conway <mail@joeconway.com>)
Список pgsql-patches
Joe Conway <mail@joeconway.com> writes:
> 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.

In the cold light of morning I started to wonder what should happen if
you write "from foo() as z" when foo returns a tuple.  It would probably
be peculiar for the z to overwrite the column name of just the first
column --- there is no such column renaming for an ordinary table alias.

My current thought: z becomes the table alias, and it also becomes the
column alias *if* the function returns scalar.  For a function returning
tuple, this syntax doesn't affect the column names.  (In any case this
syntax is disallowed for functions returning RECORD.)

            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: pg_stat_reset round 3
Следующее
От: Joe Conway
Дата:
Сообщение: Re: anonymous composite types for Table Functions (aka