Re: Does export operation cancel SQLs? - Mailing list pgsql-admin

From Tom Lane
Subject Re: Does export operation cancel SQLs?
Date
Msg-id 2583155.1740004065@sss.pgh.pa.us
Whole thread Raw
In response to Re: Does export operation cancel SQLs?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-admin
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Wed, Feb 19, 2025 at 1:57 PM Siraj G <tosiraj.g@gmail.com> wrote:
>> But I wonder if pg_dump does acquire locks?

> Everything acquires locks (basically).  It is the specific nature of the
> locks held and requested that matter.

For more color on that see

https://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES

particularly the table of lock mode conflicts.  pg_dump generally
takes ACCESS SHARE locks on the tables it plans to dump, which is
the same lock level taken by a plain SELECT.  That will only
block ACCESS EXCLUSIVE locks, which by and large are only taken
by major DDL operations.

            regards, tom lane



pgsql-admin by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Does export operation cancel SQLs?
Next
From: Jerry Sievers
Date:
Subject: Re: In-place upgrade with streaming replicas