Re: AS s(a) vs. AS a

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: AS s(a) vs. AS a
Дата
Msg-id 7050.1350008301@sss.pgh.pa.us
обсуждение исходный текст
Ответ на AS s(a) vs. AS a  (Thalis Kalfigkopoulos <tkalfigo@gmail.com>)
Список pgsql-general
Thalis Kalfigkopoulos <tkalfigo@gmail.com> writes:
> I see in the docs the following:
> SELECT current_date + s.a AS dates FROM generate_series(0,14,7) AS s(a);

> Trying it as:
> SELECT current_date + a AS dates FROM generate_series(0,14,7) AS a;

> yields exactly the same result.

> Does the finer granularity/expressiveness offer some extra
> functionality in some cases or is it a matter of style?

IIRC, it's important for functions returning composite types.  For a
function returning scalar, "AS a" is equivalent to "AS a(a)".

            regards, tom lane


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

Предыдущее
От: Vishalakshi Navaneethakrishnan
Дата:
Сообщение: Postgres DB Migration from 8.3 to 9.1
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: Postgres DB Migration from 8.3 to 9.1