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

From: david(dot)g(dot)johnston(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14626: array_agg( anyarray ) unexpected error with multi-valued single-dimension array
Date: 2017-04-19 20:43:27
Message-ID: 20170419204327.24366.56745@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14626
Logged by: David Johnston
Email address: david(dot)g(dot)johnston(at)gmail(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-04-19 21:03:52 Re: BUG #14626: array_agg( anyarray ) unexpected error with multi-valued single-dimension array
Previous Message Nico Williams 2017-04-19 19:32:13 pg_dump(1) failures when concurrently refreshing mat views