Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY
Andy Fan <zhihui.fan1213@gmail.com>
From: Andy Fan <zhihui.fan1213@gmail.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-10-15T01:04:24Z
Lists: pgsql-hackers
Hi Alvaro: On Tue, Aug 4, 2020 at 7:49 AM Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > I've been working on the ability to detach a partition from a > partitioned table, without causing blockages to concurrent activity. > I think this operation is critical for some use cases. > I think if it is possible to implement the detech with a NoWait option . ALTER TABLE ... DETACH PARTITION .. [NoWait]. if it can't get the lock, raise "Resource is Busy" immediately, without blocking others. this should be a default behavior. If people do want to keep trying, it can set a ddl_lock_timeout to 'some-interval', in this case, it will still block others(so it can't be as good as what you are doing, but very simple), however the user would know what would happen exactly and can coordinate with their application accordingly. I'm sorry about this since it is a bit of off-topics or it has been discussed already. -- Best Regards Andy Fan
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