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: olgaantonova2.0@yandex.ru
Subject: BUG #18843: ERROR: Input of anonymous composite types is not implemented in array_agg function
Date: Thu, 13 Mar 2025 10:32:57 +0000
Message-ID: <18843-14736a1b899938e8@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18843
Logged by:          Olga Antonova
Email address:      olgaantonova2.0@yandex.ru
PostgreSQL version: 16.7
Operating system:   Ubuntu 22.04.3 LTS
Description:        

How to reproduce the problem:
1. Generate test data by pgbench with scale_factor 10
pgbench -i -s 10 -U postgres -p 5434 -d test
2. Run query in test database
select bid, array_agg(ROW(aid,abalance)) from pgbench_accounts group by
bid;
Result: 
ERROR:  0A000: input of anonymous composite types is not implemented
LOCATION:  record_recv, rowtypes.c:508
Query Plan:
 QUERY PLAN                                                 
-----------------------------------------------------------------------------------------------------------
 Finalize GroupAggregate  (cost=23644.32..23646.93 rows=10 width=36)
   Group Key: bid
   ->  Gather Merge  (cost=23644.32..23646.65 rows=20 width=36)
         Workers Planned: 2
         ->  Sort  (cost=22644.29..22644.32 rows=10 width=36)
               Sort Key: bid
               ->  Partial HashAggregate  (cost=22644.00..22644.13 rows=10
width=36)
                     Group Key: bid
                     ->  Parallel Seq Scan on pgbench_accounts 
(cost=0.00..20560.67 rows=416667 width=12)
(9 rows)

When the problem does not reproduce:
1. Generate test data by pgbench with default scale_factor:
pgbench -i -U postgres -p 5434 -d test
2. Run the same query in test database:
select bid, array_agg(ROW(aid,abalance)) from pgbench_accounts group by
bid;
Result: The request was processed without errors.
Query Plan:
QUERY PLAN                                   
-------------------------------------------------------------------------------
 HashAggregate  (cost=3140.00..3140.01 rows=1 width=36)
   Group Key: bid
   ->  Seq Scan on pgbench_accounts  (cost=0.00..2640.00 rows=100000
width=12)
(3 rows)

Expected result:
The query has the same behavior for any query plan.



view thread (2+ messages)  latest in thread

Message-ID: <18843-14736a1b899938e8@postgresql.org>
Permalink:  ../18843-14736a1b899938e8@postgresql.org/
Also on:    postgresql.org/message-id/18843-14736a1b899938e8@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, olgaantonova2.0@yandex.ru
  Subject: Re: BUG #18843: ERROR: Input of anonymous composite types is not implemented in array_agg function
  In-Reply-To: <18843-14736a1b899938e8@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