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: exclusion@gmail.com
Subject: BUG #18871: Cross-partition MERGE fails with unclear internal error
Date: Fri, 28 Mar 2025 05:00:01 +0000
Message-ID: <18871-b44e3c96de3bd2e8@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18871
Logged by:          Alexander Lakhin
Email address:      exclusion@gmail.com
PostgreSQL version: 17.4
Operating system:   Ubuntu 24.04
Description:        

The following script:
CREATE TABLE pt(a int, b int) PARTITION BY LIST(a);
CREATE TABLE p1 PARTITION OF pt FOR VALUES IN (a);

MERGE INTO pt USING (SELECT 2 AS a) AS q ON pt.a = q.a
    WHEN NOT MATCHED THEN INSERT VALUES (1, 2)
    WHEN MATCHED THEN DO NOTHING;
fails with:
ERROR:  XX000: unknown action in MERGE WHEN clause
LOCATION:  ExecInitPartitionInfo, execPartition.c:962

This error is triggered on REL_15_STABLE (starting from bf5c4b3d9) ..
master.
Before bf5c4b3d9, the MERGE produced ERROR:  variable not found in subplan
target lists.

This anomaly is discovered with SQLsmith.



view thread (7+ messages)  latest in thread

Message-ID: <18871-b44e3c96de3bd2e8@postgresql.org>
Permalink:  ../18871-b44e3c96de3bd2e8@postgresql.org/
Also on:    postgresql.org/message-id/18871-b44e3c96de3bd2e8@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, exclusion@gmail.com
  Subject: Re: BUG #18871: Cross-partition MERGE fails with unclear internal error
  In-Reply-To: <18871-b44e3c96de3bd2e8@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