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