pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: james.inform@pharmapp.de
Subject: BUG #17387: Working in PG13 but not in PGH14: array_agg(RECORD)
Date: Fri, 28 Jan 2022 17:22:06 +0000
Message-ID: <17387-5dfe54b988444963@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17387
Logged by:          James Inform
Email address:      james.inform@pharmapp.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



view thread (7+ messages)  latest in thread

Message-ID: <17387-5dfe54b988444963@postgresql.org>
Permalink:  ../17387-5dfe54b988444963@postgresql.org/
Also on:    postgresql.org/message-id/17387-5dfe54b988444963@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, james.inform@pharmapp.de
  Subject: Re: BUG #17387: Working in PG13 but not in PGH14: array_agg(RECORD)
  In-Reply-To: <17387-5dfe54b988444963@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox