Re: [HACKERS] need of anonymous record

2014-05-04 Thread Tom Lane
Craig Ringer writes: > What you appear to want is to access arbitrary fields of a record by name. > The reason this isn't supported directly in PL/PgSQL is, AFAIK, mainly > an issue of data typing. Each field in a record may be of a different > type. So the return type would change based on the f

Re: [HACKERS] need of anonymous record

2014-05-04 Thread Craig Ringer
On 05/03/2014 09:55 PM, Peter Krauss wrote: > If "yes", the /record/ datatype is somewhat outdated? No, it isn't. `RETURNS TABLE` is functionally the same as `RETURNS SETOF RECORD` with `OUT` parameters. However, `RETURNS SETOF RECORD` can return arbitrary records of no fixed structure too, and

Re: [HACKERS] need of anonymous record

2014-05-03 Thread Andrew Dunstan
On 05/03/2014 09:55 AM, Peter Krauss wrote: My notion of "anonymous record", and the need of this kind of "higher-order type", are discussed in the links below, http://stackoverflow.com/q/23439240 "Functions can not to /return individual items of a record/" http://stackoverflow.com/q/212462

Re: [HACKERS] need of anonymous record

2014-05-03 Thread David G Johnston
Peter Padua Krauss wrote > The first question is about performance: "*returns table*" have the same > performance than "*returns record*"?? > If "yes", the *record* datatype is somewhat outdated? Table defines the possibility to return a set while record can only ever return a single value; so lik

[HACKERS] need of anonymous record

2014-05-03 Thread Peter Krauss
My notion of "anonymous record", and the need of this kind of "higher-order type", are discussed in the links below, http://stackoverflow.com/q/23439240 "Functions can not to *return individual items of a record*" http://stackoverflow.com/q/21246201 "PostgreSQL v9.X have real '*array of recor