Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY

Поиск
Список
Период
Сортировка
От Andy Fan
Тема Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY
Дата
Msg-id CAKU4AWrme6KPToAGJrzPFwaLu_aFqAoXbiSKLR8HTnDwB00z2A@mail.gmail.com
обсуждение исходный текст
Ответ на ALTER TABLE .. DETACH PARTITION CONCURRENTLY  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY  (David Rowley <dgrowleyml@gmail.com>)
Список 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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: jit and explain nontext
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY