Re: SELECT syntax synopsis: column_definition?

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: SELECT syntax synopsis: column_definition?
Дата
Msg-id 50700110-2B0D-4935-B033-084ED908BEC5@seespotcode.net
обсуждение исходный текст
Ответ на SELECT syntax synopsis: column_definition?  (Richard Broersma Jr <rabroersma@yahoo.com>)
Ответы Re: SELECT syntax synopsis: column_definition?  (Michael Glaesemann <grzm@seespotcode.net>)
Re: SELECT syntax synopsis: column_definition?  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-sql
On Aug 21, 2007, at 14:34 , Richard Broersma Jr wrote:

> Can any one give an example of the difference between a  
> column_alias and a column_definition when
> using a function in the FROM clause?
>
> from the manual:
> http://www.postgresql.org/docs/8.2/interactive/sql-select.html
>
> "function_name ( [ argument [, ...] ] ) [ AS ] alias  
> [ ( column_alias [, ...] | column_definition
> [, ...] ) ]"

I believe it's similar to this

# select * from generate_series(1,10) as a(s);
s
----  1  2  3  4  5  6  7  8  9
10
(10 rows)

But like this:

# select * from generate_series(1,10) as a(s text);

But not quite, as this raises an error :)

ERROR:  a column definition list is only allowed for functions  
returning "record"

So the *form* is right, but I don't know of an example that works.

You've got me curious now, too!

Michael Glaesemann
grzm seespotcode net




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

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Make a SQL statement not run trigger
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: SELECT syntax synopsis: column_definition?