pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make pg_dump acquire lock on partitioned tables that are to be d
Date: Sat, 16 Oct 2021 16:25:23 +0000
Message-ID: <E1mbmUt-0002hw-Ix@gemulon.postgresql.org> (raw)

Make pg_dump acquire lock on partitioned tables that are to be dumped.

It was clearly the intent to do so all along, but the original coding
fat-fingered this by checking the wrong array element.  We fixed it
in passing in 403a3d91c, but that later got reverted, and we forgot
to keep this bug fix.

Most of the time this'd be relatively harmless, since once we lock
any of the partitioned table's leaf partitions, that would suffice
to prevent major DDL on the partitioned table itself.  However, a
childless partitioned table would get dumped with no relevant lock
whatsoever, possibly allowing dump failure or inconsistent output.

Unlike 403a3d91c, there are no versioning concerns, since every server
version that has partitioned tables will allow you to lock one.

Back-patch to v10 where partitioned tables were introduced.

Discussion: https://postgr.es/m/1018205.1634346327@sss.pgh.pa.us

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b5152e3ba688e7023f0e5f1a1b82b77bedadaafa

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1mbmUt-0002hw-Ix@gemulon.postgresql.org>
Permalink:  ../E1mbmUt-0002hw-Ix@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mbmUt-0002hw-Ix@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Make pg_dump acquire lock on partitioned tables that are to be d
  In-Reply-To: <E1mbmUt-0002hw-Ix@gemulon.postgresql.org>
  References: <E1mbmUt-0002hw-Ix@gemulon.postgresql.org>

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

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