Re: [GENERAL] How to store multiple rows in array .

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] How to store multiple rows in array .
Дата
Msg-id 11642.1511116381@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] How to store multiple rows in array .  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: [GENERAL] How to store multiple rows in array .  (brahmesr <brahmam1234@gmail.com>)
Список pgsql-general
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2017-11-19 18:57 GMT+01:00 Brahmam Eswar <brahmam1234@gmail.com>:
>> How to collect multiple columns into array which is composite data type of
>> all select colums

> SELECT ARRAY(SELECT ROW(col1, col2, ...) INTO

You probably need an explicit cast to the rowtype.  That is,
declare myarray rowtypename[];...select array(select row(col1, ...)::rowtypename from ...) into myarray;
        regards, tom lane


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

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

Предыдущее
От: Chris Mair
Дата:
Сообщение: [GENERAL] parallel query in 9.6.6 + oracle_fdw -> ERROR: invalid cache ID: 41
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] parallel query in 9.6.6 + oracle_fdw -> ERROR: invalid cache ID: 41