Search Postgresql Archives

Re: AS s(a) vs. AS a

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thalis Kalfigkopoulos <tkalfigo@xxxxxxxxx> 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux