Re: Anonymous code block with parameters

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>, Hannu Krosing <hannu(at)2ndQuadrant(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Kalyanov Dmitry <kalyanov(dot)dmitry(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Anonymous code block with parameters
Date: 2014-09-18 20:40:28
Message-ID: 541B433C.1000008@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-09-18 10:29 PM, Vik Fearing wrote:
> On 09/18/2014 10:16 PM, Hannu Krosing wrote:
>> I guess it proves (a little) that WITH is the right place to do these
>> kind of things ...
>
> I've been wanting this syntax for a few years now, so I certainly vote
> for it.

I've also been wanting do to something like:

WITH mytyp AS (a int, b int, c int)
SELECT (tup).* FROM
(
SELECT CASE WHEN .. THEN ROW(1,2,3)::mytyp
WHEN .. THEN ROW(2,3,4)
ELSE ROW (3,4,5) END AS tup
FROM ..
) ss

.marko

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Adrian Klaver 2014-09-18 21:47:04 Re: [GENERAL] [SQL] pg_multixact issues
Previous Message Josh Berkus 2014-09-18 20:35:31 Re: Anonymous code block with parameters