Re: Anonymous code block with parameters

Marko Tiikkaja <marko@joh.to>

From: Marko Tiikkaja <marko@joh.to>
To: Merlin Moncure <mmoncure@gmail.com>, Hannu Krosing <hannu@2ndquadrant.com>
Cc: Vik Fearing <vik.fearing@dalibo.com>, Pavel Stehule <pavel.stehule@gmail.com>, Andres Freund <andres@2ndquadrant.com>, Heikki Linnakangas <hlinnakangas@vmware.com>, Craig Ringer <craig@2ndquadrant.com>, Kalyanov Dmitry <kalyanov.dmitry@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2014-09-19T18:52:34Z
Lists: pgsql-hackers
On 2014-09-19 8:20 PM, Merlin Moncure wrote:
> actually, this trick *only* works during json serialization -- it
> allows control over the column names that row() masks over.  trying to
> expand (tup).* still gives the dreaded "ERROR:  record type has not
> been registered".  That's because this works:
>
> select (q).* from (select 1 as a, 2 as b) q;
>
> but this doesn't:
>
> select ((select q from (select a,b) q)).* from (select 1 as a, 2 as b) q;

Yeah.  This is a seriously missing feature and a PITA. :-(


.marko