Re: [GENERAL] How to store multiple rows in array . - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] How to store multiple rows in array .
Date
Msg-id 11642.1511116381@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] How to store multiple rows in array .  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: [GENERAL] How to store multiple rows in array .
List 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 by date:

Previous
From: Chris Mair
Date:
Subject: [GENERAL] parallel query in 9.6.6 + oracle_fdw -> ERROR: invalid cache ID: 41
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] parallel query in 9.6.6 + oracle_fdw -> ERROR: invalid cache ID: 41