Re: Transaction locks on first insert into partitioned table partition
David Rowley <[email protected]> Sat, 8 Jun 2019 18:49:18 +1200
| Newsgroups | gmane.comp.db.postgresql.novice |
|---|---|
| Message-ID | <CAKJS1f-V+4qStAf2kT37zPo58ESAFJV0GZCLW6GPoYc4OU7E3Q@mail.gmail.com> |
On Fri, 7 Jun 2019 at 19:06, Martin Lund Askøe <[email protected]> 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