Re: SELECT syntax synopsis: column_definition? - Mailing list pgsql-sql

From Gregory Stark
Subject Re: SELECT syntax synopsis: column_definition?
Date
Msg-id 87zm0kigwe.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: SELECT syntax synopsis: column_definition?  (Michael Glaesemann <grzm@seespotcode.net>)
Responses Re: SELECT syntax synopsis: column_definition?  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Re: SELECT syntax synopsis: column_definition?  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: SELECT syntax synopsis: column_definition?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
"Michael Glaesemann" <grzm@seespotcode.net> 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.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


pgsql-sql by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: SELECT syntax synopsis: column_definition?
Next
From: "Scott Marlowe"
Date:
Subject: Re: SELECT syntax synopsis: column_definition?