Thread

  1. BUG #18843: ERROR: Input of anonymous composite types is not implemented in array_agg function

    The Post Office <noreply@postgresql.org> — 2025-03-13T10:32:57Z

    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.
    
    
  2. Re: BUG #18843: ERROR: Input of anonymous composite types is not implemented in array_agg function

    Tom Lane <tgl@sss.pgh.pa.us> — 2025-03-13T14:43:04Z

    PG Bug reporting form <noreply@postgresql.org> writes:
    > 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;
    
    This is presumably the same issue recently reported at
    
    https://postgr.es/m/flat/atLI5Kce2ie1zcYjU0w_kjtVaxiYbYGTihrkLDmGZQnRDD4pnXukIATaABbnIj9pUnelC4ESvCXMm4HAyHg-v61XABaKpERj0A2IXzJZM7g=@dineserve.com
    
    			regards, tom lane