Race condition while creating a new partition

Поиск
Список
Период
Сортировка
Искать
От
Andrei Zhidenkov
Тема
Race condition while creating a new partition
Дата
Msg-id
FDFDBCC0-3AC5-44A7-A69F-D607CBA5A662@n26.com
Список
Дерево обсуждения
Race condition while creating a new partition Andrei Zhidenkov <andrei.zhidenkov@n26.com>
Re: Race condition while creating a new partition Andrei Zhidenkov <andrei.zhidenkov@n26.com>
Re: Race condition while creating a new partition Justin <zzzzz.graf@gmail.com>
Re: Race condition while creating a new partition Andrei Zhidenkov <andrei.zhidenkov@n26.com>
Re: Race condition while creating a new partition Justin <zzzzz.graf@gmail.com>
Re: Race condition while creating a new partition Michael Lewis <mlewis@entrata.com>
Re: Race condition while creating a new partition Andrei Zhidenkov <andrei.zhidenkov@n26.com>
We use this code in order to automatically create new partitions for a partitioned table (Postgres 10.6):

begin
  insert into ;
exception when undefined_table then
  begin
    
    -- A concurrent txn has created the new partition
    exception when others then end;
    -- Insert data into the new partition
    insert into ;
  end;
end;

As far as I understand we should always have a new partition created either in current or in concurrent transaction but today we faced the problem when we failed to insert data due to a partition nonexistence for a small period of time. Have I missed something?

Thank you.

—

With best regards, Andrei Zhidenkov.

В списке pgsql-general по дате отправления
От: Arup Rakshit
Дата:
От: PegoraroF10
Дата:
Сообщение: naming triggers for execution
FAQ