mirror of
https://github.com/postgres/postgres.git
synced 2025-11-03 09:13:20 +03:00
Ignore partitioned tables when processing ON COMMIT DELETE ROWS
Those tables have no physical storage, making this option unusable with partition trees as at commit time an actual truncation was attempted. There are still issues with the way ON COMMIT actions are done when mixing several action types, however this impacts as well inheritance trees, so this issue will be dealt with later. Reported-by: Rajkumar Raghuwanshi Author: Amit Langote Reviewed-by: Michael Paquier, Tom Lane Discussion: https://postgr.es/m/CAKcux6mhgcjSiB_egqEAEFgX462QZtncU8QCAJ2HZwM-wWGVew@mail.gmail.com
This commit is contained in:
@@ -3181,6 +3181,13 @@ heap_truncate_one_rel(Relation rel)
|
||||
{
|
||||
Oid toastrelid;
|
||||
|
||||
/*
|
||||
* Truncate the relation. Partitioned tables have no storage, so there is
|
||||
* nothing to do for them here.
|
||||
*/
|
||||
if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
|
||||
return;
|
||||
|
||||
/* Truncate the actual file (and discard buffers) */
|
||||
RelationTruncate(rel, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user