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

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: is any reason why only one columns subselect are allowed in array()?
Дата
Msg-id 162867790811180820l32a82004m186e872f66fe1ba0@mail.gmail.com
обсуждение исходный текст
Ответ на Re: is any reason why only one columns subselect are allowed in array()?  (Sam Mason <sam@samason.me.uk>)
Ответы Re: is any reason why only one columns subselect are allowed in array()?  (Sam Mason <sam@samason.me.uk>)
Список pgsql-hackers
2008/11/18 Sam Mason <sam@samason.me.uk>:
> On Tue, Nov 18, 2008 at 07:37:44AM -0800, David Fetter wrote:
>> On Tue, Nov 18, 2008 at 10:29:53AM -0500, Robert Haas wrote:
>> > Seems like you could just write SELECT ARRAY[col1, col2, col3]
>> > instead of SELECT col1, col2, col3.
>>
>> If I understand this right, Pavel is thinking that
>>
>>     ARRAY(SELECT col1, col2, col3...)
>>
>> should produce an array each element of which is the compound type
>> consisting of (col1, col2, col3), and if it doesn't produce one, we're
>> looking at a pretty large POLA violation.
>
> 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.

this is different result - it's array of records, not 2d array.

regards
Pavel

>
>
>  Sam
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: Re: is any reason why only one columns subselect are allowed in array()?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: [BUGS] libpq does not manage SSL callbacks properly when other libraries are involved.