BUG #18550: Cross-partition update of a former inheritance parent leads to an assertion failure

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 #18550: Cross-partition update of a former inheritance parent leads to an assertion failure
Date: 2024-07-23 13:00:00
Message-ID: 18550-d5e047e9a897a889@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18550
Logged by: Alexander Lakhin
Email address: exclusion(at)gmail(dot)com
PostgreSQL version: 17beta2
Operating system: Ubuntu 22.04
Description:

The following script:
CREATE TABLE t1 (a int);
CREATE TABLE t2 () INHERITS (t1);
DROP TABLE t2;
CREATE TABLE t (a int) PARTITION BY LIST (a);
ALTER TABLE t ATTACH PARTITION t1 FOR VALUES IN (1);
INSERT INTO t1 VALUES (1);
UPDATE t1 SET a = 2 WHERE a = 1

triggers an assertion failure (due to t1 is not recognized as a leaf
partition):
TRAP: failed Assert("rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE"),
File: "partdesc.c", Line: 73, PID: 37464
ExceptionalCondition at assert.c:52:13
RelationGetPartitionDesc at partdesc.c:83:6
PartitionDirectoryLookup at partdesc.c:458:11
ExecInitPartitionDispatchInfo at execPartition.c:1128:13
ExecSetupPartitionTupleRouting at execPartition.c:240:9
ExecCrossPartitionUpdate at nodeModifyTable.c:1791:39
ExecUpdateAct at nodeModifyTable.c:2046:7
ExecUpdate at nodeModifyTable.c:2336:12
ExecModifyTable at nodeModifyTable.c:4114:12
ExecProcNodeFirst at execProcnode.c:465:1
ExecProcNode at executor.h:275:1
ExecutePlan at execMain.c:1646:10
standard_ExecutorRun at execMain.c:363:3
ExecutorRun at execMain.c:305:1
ProcessQuery at pquery.c:165:5
PortalRunMulti at pquery.c:1277:5
PortalRun at pquery.c:795:5

Reproduced on REL_14_STABLE (starting from 8f4a6b9e4) .. master.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Erik Wienhold 2024-07-23 13:31:13 Re: A generated column cannot be part of a partition key
Previous Message Diego Stammerjohann 2024-07-23 12:01:31 Re: A generated column cannot be part of a partition key