Re: is any reason why only one columns subselect are allowed in array()?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: is any reason why only one columns subselect are allowed in array()?
Date: 2008-11-18 18:02:08
Message-ID: 21990.1227031328@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sam Mason <sam(at)samason(dot)me(dot)uk> writes:
> I've used this syntax before and got a surprising message back. I'd
> expect to be able to do the following:
> ARRAY((SELECT col1, col2 FROM (VALUES ('a',1), ('b',2)) x(col1,col2)));
> and get the following back {"(a,1)","(b,2)"}. So I think I'm with
> David.

I concur --- if we support something like this, the behavior should be
that you get an array of record. Pavel's proposal for a 2-D array seems
unworkably restrictive. And I certainly don't want to end up in a
situation where we return either a 2-D array or array of record
depending on whether the parser thinks the column data types match ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2008-11-18 18:13:54 Re: is any reason why only one columns subselect are allowed in array()?
Previous Message Joshua D. Drake 2008-11-18 17:59:16 Re: Block-level CRC checks