Re: [BUGS] BUG #14626: array_agg( anyarray ) unexpected error with multi-valued single-dimension array

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #14626: array_agg( anyarray ) unexpected error with multi-valued single-dimension array
Дата
Msg-id 30751.1492635832@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [BUGS] BUG #14626: array_agg( anyarray ) unexpected error with multi-valuedsingle-dimension array  (david.g.johnston@gmail.com)
Ответы Re: [BUGS] BUG #14626: array_agg( anyarray ) unexpected error withmulti-valued single-dimension array  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
david.g.johnston@gmail.com writes:
> This doesn't, and should since the number of elements in the non-empty array
> shouldn't change the dimensionality logic.

> SELECT array_agg(CASE WHEN a = ARRAY[]::text[] THEN ARRAY['N/A']::text[]
> ELSE a END)
> FROM ( VALUES (1, ARRAY[]::text[]), (1, ARRAY['1','2']::text[]) ) vals (v,
> a)

Why do you think that should work?  You're asking array_agg to accumulate
a 1-D length-1 array and then a 1-D length-2 array.  There's no way to
make a rectangular 2-D array out of that, except perhaps by inventing
entries which isn't in array_agg's charter.
        regards, tom lane


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

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

Предыдущее
От: david.g.johnston@gmail.com
Дата:
Сообщение: [BUGS] BUG #14626: array_agg( anyarray ) unexpected error with multi-valuedsingle-dimension array
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] pg_dump(1) failures when concurrently refreshing mat views