[BUGS] BUG #14626: array_agg( anyarray ) unexpected error with multi-valuedsingle-dimension array - Mailing list pgsql-bugs

From david.g.johnston@gmail.com
Subject [BUGS] BUG #14626: array_agg( anyarray ) unexpected error with multi-valuedsingle-dimension array
Date
Msg-id 20170419204327.24366.56745@wrigleys.postgresql.org
Whole thread Raw
Responses Re: [BUGS] BUG #14626: array_agg( anyarray ) unexpected error with multi-valued single-dimension array  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14626
Logged by:          David Johnston
Email address:      david.g.johnston@gmail.com
PostgreSQL version: 9.5.6
Operating system:   Ubuntu 14.04
Description:

In short...

This works:

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

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)

David J.



--
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 by date:

Previous
From: Nico Williams
Date:
Subject: [BUGS] pg_dump(1) failures when concurrently refreshing mat views
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14626: array_agg( anyarray ) unexpected error with multi-valued single-dimension array