BUG #17387: Working in PG13 but not in PGH14: array_agg(RECORD)

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: james(dot)inform(at)pharmapp(dot)de
Subject: BUG #17387: Working in PG13 but not in PGH14: array_agg(RECORD)
Date: 2022-01-28 17:22:06
Message-ID: 17387-5dfe54b988444963@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: 17387
Logged by: James Inform
Email address: james(dot)inform(at)pharmapp(dot)de
PostgreSQL version: 14.1
Operating system: Mac and Linux (Ubuntu)
Description:

While the following sql works under PG13:

with q_data as (
select '1' as testa, 1 as testb
union
select '2' as testa, 2 as testb
union
select '3' as testa, 3 as testb
union
select '4' as testa, 4 as testb
)
select array_agg(q) || array_agg(q) from q_data q;

and results in:
{"(3,3)","(1,1)","(4,4)","(2,2)","(3,3)","(1,1)","(4,4)","(2,2)"}

the same SQL on PG14.1 fails with:

ERROR: operator is not unique: record[] || record[]
LINE 10: select array_agg(q) || array_agg(q) from q_data q;
^
HINT: Could not choose a best candidate operator. You might need to add
explicit type casts.

Let's not discuss if such an sql makes sense.
But question is: Why is PG14 giving an error while PG13 works?

Cheers,
James

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavel Stehule 2022-01-28 20:19:57 Re: BUG #17387: Working in PG13 but not in PGH14: array_agg(RECORD)
Previous Message Drouvot, Bertrand 2022-01-28 16:17:20 snapshot recovery conflict despite hot_standby_feedback set to on