agora inbox for pgsql-admin@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Siraj G <tosiraj.g@gmail.com>
Cc: Scott Ribe <scott_ribe@elevated-dev.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Does export operation cancel SQLs?
Date: Wed, 19 Feb 2025 17:27:45 -0500
Message-ID: <2583155.1740004065@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYy=DpdvuXAfV1OD_Kb0hEjhGkgfHbi9LvZ5HSzeVga6g@mail.gmail.com>
References: <CAC5iy62t+KuBZJGLjDQ54w6QyELZZyPisacuKvW+KT_+UomPfw@mail.gmail.com>
	<CAKFQuwbRW77=4zboZfOv3_E7ct-36gNvnEfk38GhPbCUcNR5Qw@mail.gmail.com>
	<098b7dbed4aa52c97b6159b26c36129ff2f10409.camel@cybertec.at>
	<CANzqJaAYzSi6zW_fGF8pO_r4Cc5DL8qEvQnBRreTV1KhjY65DQ@mail.gmail.com>
	<CAMkU=1xRrZSJR=k_LaVy-jUe4hp_XXfLN-3QDahz3w+JJ82QcA@mail.gmail.com>
	<CAC5iy62nUzM-4WEWBw3f0-YwMT2dA6RhoSw7cm02abgwVBf64A@mail.gmail.com>
	<D4B1A35C-035B-4139-B596-170EAC292633@elevated-dev.com>
	<CAC5iy63wUT8JxUeu6fUKKT6VOZtC3sT+yDJg+-+9Rtrqc14Vbg@mail.gmail.com>
	<CAKFQuwYy=DpdvuXAfV1OD_Kb0hEjhGkgfHbi9LvZ5HSzeVga6g@mail.gmail.com>

"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





view thread (17+ messages)

Message-ID: <2583155.1740004065@sss.pgh.pa.us>
Permalink:  ../2583155.1740004065@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2583155.1740004065@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, tosiraj.g@gmail.com, scott_ribe@elevated-dev.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Does export operation cancel SQLs?
  In-Reply-To: <2583155.1740004065@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox