BUG #19099: Conditional DELETE from partitioned table with non-updatable partition raises internal error

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: exclusion(at)gmail(dot)com
Subject: BUG #19099: Conditional DELETE from partitioned table with non-updatable partition raises internal error
Date: 2025-10-29 20:00:02
Message-ID: 19099-e05dcfa022fe553d@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19099
Logged by: Alexander Lakhin
Email address: exclusion(at)gmail(dot)com
PostgreSQL version: 18.0
Operating system: Ubuntu 24.04
Description:

The following script:
CREATE EXTENSION file_fdw;
CREATE SERVER file_server FOREIGN DATA WRAPPER file_fdw;
CREATE TABLE pt (a int, b text) partition by list (a);
CREATE FOREIGN TABLE p1 partition of pt for values in (1) SERVER file_server
OPTIONS (format 'csv', filename '/tmp/1.csv');
SET enable_partition_pruning = 'off';
EXPLAIN DELETE FROM pt WHERE false;

raises:
ERROR: XX000: could not find junk ctid column
LOCATION: ExecInitModifyTable, nodeModifyTable.c:4867
(Discovered with SQLsmith.)

Reproduced starting from 86dc9005.

On 86dc9005~1 or with enable_partition_pruning = 'on', EXPLAIN outputs the
query plan and "DELETE FROM pt WHERE false;" completes with no error.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2025-10-29 20:19:29 Re: BUG #19042: Option --help not recognized at the end of command line in pg_restore
Previous Message Tomas Vondra 2025-10-29 19:08:58 Re: BUG #19096: Hugepages configuration is probably not reserving the allocated number of pages