pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix lock level used for partition when detaching it
Date: Thu, 20 Dec 2018 19:44:48 +0000
Message-ID: <E1ga4FU-0005Cv-8W@gemulon.postgresql.org> (raw)

Fix lock level used for partition when detaching it

For probably bogus reasons, we acquire only AccessShareLock on the
partition when we try to detach it from its parent partitioned table.
This can cause ugly things to happen if another transaction is doing
any sort of DDL to the partition concurrently.

Upgrade that lock to ShareUpdateExclusiveLock, which per discussion
seems to be the minimum needed.

Reported by Robert Haas.

Discussion: https://postgr.es/m/CA+TgmoYruJQ+2qnFLtF1xQtr71pdwgfxy3Ziy-TxV28M6pEmyA@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/053ad56d275d343b407bc5fd389bad6f3e340562

Modified Files
--------------
src/backend/commands/tablecmds.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1ga4FU-0005Cv-8W@gemulon.postgresql.org>
Permalink:  ../E1ga4FU-0005Cv-8W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ga4FU-0005Cv-8W@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Fix lock level used for partition when detaching it
  In-Reply-To: <E1ga4FU-0005Cv-8W@gemulon.postgresql.org>
  References: <E1ga4FU-0005Cv-8W@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