On 8/21/07, Gregory Stark <[EMAIL PROTECTED]> wrote:
> "Michael Glaesemann" <[EMAIL PROTECTED]> writes:
>
> > 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.
>
> postgres=# create function testf() returns record as 'select 1' language sql;
> CREATE FUNCTION
> postgres=# select * from testf() as (i integer);
> i
> ---
> 1
> (1 row)
>
>
> I haven't quite figured out how this is useful though. It probably makes more
> sense if you use plpgsql but I still don't quite see what the use case is.
I use them with the crosstab function in the tablefunc contrib module.
---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate