pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Luzanov <p.luzanov@postgrespro.ru>
To: Amit Langote <amitlangote09@gmail.com>
To: Álvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Subject: Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY
Date: Wed, 5 May 2021 13:58:59 +0300
Message-ID: <0688e7c3-8bc8-a3e4-9d8e-3bcbbf3e1f4d@postgrespro.ru> (raw)
In-Reply-To: <CA+HiwqE7GxGU4VdzwZzfiz+Ont5SsopoFkgtrZGEdPqWRL+biA@mail.gmail.com>
References: <20210427163226.GA30032@alvherre.pgsql>
	<20210427233211.GA21358@alvherre.pgsql>
	<CA+HiwqEHsRA9AWk=NKG_yVLRX7KSF7K44wS7=PnNj+d8ZsNR0A@mail.gmail.com>
	<f12cee75-02cc-43a7-bbd0-6487b8634934@www.fastmail.com>
	<CA+HiwqE7GxGU4VdzwZzfiz+Ont5SsopoFkgtrZGEdPqWRL+biA@mail.gmail.com>

Hello,

I found this in the documentation, section '5.11.3. Partitioning Using 
Inheritance'[1]:
"Some operations require a stronger lock when using declarative 
partitioning than when using table inheritance. For example, removing a 
partition from a partitioned table requires taking an ACCESS EXCLUSIVE 
lock on the parent table, whereas a SHARE UPDATE EXCLUSIVE lock is 
enough in the case of regular inheritance."

This point is no longer valid with some restrictions. If the table has a 
default partition, then removing a partition still requires taking an 
ACCESS EXCLUSIVE lock.

May be make sense to add some details about DETACH CONCURRENTLY to the 
section '5.11.2.2. Partition Maintenance' and completely remove this point?

1. 
https://www.postgresql.org/docs/devel/ddl-partitioning.html#DDL-PARTITIONING-USING-INHERITANCE

Pavel Luzanov
Postgres Professional: https://postgrespro.com
The Russian Postgres Company

view thread (87+ messages)  latest in thread

Message-ID: <0688e7c3-8bc8-a3e4-9d8e-3bcbbf3e1f4d@postgrespro.ru>
Permalink:  ../0688e7c3-8bc8-a3e4-9d8e-3bcbbf3e1f4d@postgrespro.ru/
Also on:    postgresql.org/message-id/0688e7c3-8bc8-a3e4-9d8e-3bcbbf3e1f4d@postgrespro.ru

 · 

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-hackers@postgresql.org
  Cc: p.luzanov@postgrespro.ru, amitlangote09@gmail.com, alvherre@alvh.no-ip.org, pryzby@telsasoft.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY
  In-Reply-To: <0688e7c3-8bc8-a3e4-9d8e-3bcbbf3e1f4d@postgrespro.ru>

* 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