Re: Transaction locks on first insert into partitioned table partition

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Transaction locks on first insert into partitioned table partition
Дата
Msg-id CAKJS1f-V+4qStAf2kT37zPo58ESAFJV0GZCLW6GPoYc4OU7E3Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Transaction locks on first insert into partitioned table partition  (Martin Lund Askøe <martinlundaskoe@gmail.com>)
Ответы Re: Transaction locks on first insert into partitioned table partition  (Martin Lund Askøe <martinlundaskoe@gmail.com>)
Список pgsql-novice
On Fri, 7 Jun 2019 at 19:06, Martin Lund Askøe
<martinlundaskoe@gmail.com> wrote:
> Do you know if there is any way to force update the relcache entry during my 'attach'-transaction?

You could just do a dummy insert after the ATTACH PARTITION
transaction ends and before the transaction where you start inserting
the data. Something like:

insert into partition_table_2019_01_01 (id, some_info, e_timestamp)
select 1,'',now() where 1=0;

That'll build and cache the partition bound in the partitions relcache entry.

I'm curious to know why you have concerns about the AccessShareLock on
the partitioned table being held during the insert. Can you explain
that?

--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Martin Lund Askøe
Дата:
Сообщение: Re: Transaction locks on first insert into partitioned table partition
Следующее
От: Martin Lund Askøe
Дата:
Сообщение: Re: Transaction locks on first insert into partitioned table partition