Re: Table locking during backup

2019-10-08 Thread Tom Lane
=?utf-8?Q?Artur_Zaj=C4=85c?= writes: > First session: > BEGIN; > set transaction isolation level repeatable read, read only; > lock TABLE gm.tableabc IN access share mode; > Second session: > BEGIN; > CREATE TEMP TABLE IF NOT EXISTS tableabc (Id BIGINT DEFAULT random()) > INHERITS (gm.tableabc)

RE: Table locking during backup

2019-10-07 Thread Artur Zając
> Not sure why would it matter that the pg_dump connection is read-only, this > is about locking because > pg_dump needs to ensure the schema does not change while it's running. > pg_dump does not do > > LOCK TABLE gm.tableabc; > > but > > LOCK TABLE gm.tableabc IN ACCESS SHARE MODE; > > Wh

Re: Table locking during backup

2019-10-07 Thread Tomas Vondra
On Mon, Oct 07, 2019 at 11:00:08PM +0200, Artur Zając wrote: Hi, I cannot reproduce some scenario I found in my PostgreSQL logs. I have two connections/processes: Process 24755 is standard pg_backup connection with: . BEGIN; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY

Table locking during backup

2019-10-07 Thread Artur Zając
Hi, I cannot reproduce some scenario I found in my PostgreSQL logs. I have two connections/processes: Process 24755 is standard pg_backup connection with: . BEGIN; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY . LOCK TABLE gm.tableabc; . COPY FROM gm.tableabc