Re: Converting row elements into a arrays?
От
Ron
Тема
Re: Converting row elements into a arrays?
Дата
Msg-id
36f53642-db43-4fc9-028e-8b6cd3dff9b4@gmail.com
Ответ на
Re: Converting row elements into a arrays? (Rob Sargent)
Список
Дерево обсуждения
Converting row elements into a arrays? Ron <ronljohnsonjr@gmail.com>
Re: Converting row elements into a arrays? Ray O'Donnell <ray@rodonnell.ie>
Re: Converting row elements into a arrays? Ron <ronljohnsonjr@gmail.com>
Re: Converting row elements into a arrays? Ray O'Donnell <ray@rodonnell.ie>
Re: Converting row elements into a arrays? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Converting row elements into a arrays? Ron <ronljohnsonjr@gmail.com>
Re: Converting row elements into a arrays? Merlin Moncure <mmoncure@gmail.com>
Re: Converting row elements into a arrays? Pavel Stehule <pavel.stehule@gmail.com>
Re: Converting row elements into a arrays? Rob Sargent <robjsargent@gmail.com>
Re: Converting row elements into a arrays? Ron <ronljohnsonjr@gmail.com>
Re: Converting row elements into a arrays? Rob Sargent <robjsargent@gmail.com>
On 3/2/23 15:45, Rob Sargent wrote:
> On 3/2/23 13:58, Ron wrote:
>> Postgresql 12.13
>>
>> Given the sample below, I'm looking for how to generate this output.
>> It's like GROUP BY, but generating an array instead of an aggreate number.
>> f1 | f2_array
>> ----+---------
>> 1 | {1,2,3}
>> 2 | {1,2,3,4}
>> 3 | {1,2}
>>
>> The ultimate goal is to somehow use pg_index.indkey to get column names
>> from pg_attribute.
>>
>> create table foo (f1 int, f2 int);
>> insert into foo values (1, 1);
>> insert into foo values (1, 2);
>>
[snip]
>
> In which environment are you accessing that array? psql only?
Correct.
--
Born in Arizona, moved to Babylonia.
В списке pgsql-general по дате отправления