Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY
Hao Wu <hawu@vmware.com>
From: Hao Wu <hawu@vmware.com>
To: Robert Haas <robertmhaas@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-09-02T04:25:16Z
Lists: pgsql-hackers
Not related to DETACH PARTITION, but I found a bug in ATTACH PARTITION. Here are the steps to reproduce the issue: create table tpart(i int, j int) partition by range(i); create table tpart_1(like tpart); create table tpart_2(like tpart); create table tpart_default(like tpart);alter table tpart attach partition tpart_1 for values from(0) to (100); alter table tpart attach partition tpart_default default;insert into tpart_2 values(110,110),(120,120),(150,150);1: begin; 1: alter table tpart attach partition tpart_2 for values from(100) to (200); 2: begin; -- insert will be blocked by ALTER TABLE ATTACH PARTITION 2: insert into tpart values (110,110),(120,120),(150,150); 1: end; 2: select * from tpart_default; 2: end; After that the partition tpart_default contains (110,110),(120,120),(150,150) inserted in session 2, which obviously violates the partition constraint. Regards, Hao Wu
Commits
-
Make detach-partition-concurrently-4 less timing sensitive
- eb43bdbf5104 14.0 landed
-
Improve documentation on DETACH PARTITION lock levels
- db6e1aeb952e 14.0 landed
-
Track detached partitions more accurately in partdescs
- 3fe773b14975 14.0 landed
-
Allow a partdesc-omitting-partitions to be cached
- d6b8d29419df 14.0 landed
-
Fix relcache inconsistency hazard in partition detach
- 8aba9322511f 14.0 landed
-
Don't add a redundant constraint when detaching a partition
- 7b357cc6ae55 14.0 landed
-
ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY
- 71f4c8c6f74b 14.0 landed
-
Let ALTER TABLE Phase 2 routines manage the relation pointer
- cd03c6e94b09 14.0 landed
-
Check default partitions constraints while descending
- f481d2823297 14.0 landed
- ef1e1250e716 12.5 landed
- d0230a43fcae 13.0 landed