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>
Cc: Á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: Thu, 6 May 2021 14:22:56 +0300
Message-ID: <7b1ff3fb-2002-a09e-8e60-1b79086ac294@postgrespro.ru> (raw)
In-Reply-To: <CA+HiwqHJK7H6g8+rMhyMtxjgXefzdEk2yKTdB3LCFdNMw4Ct+w@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>
	<0688e7c3-8bc8-a3e4-9d8e-3bcbbf3e1f4d@postgrespro.ru>
	<CA+HiwqHJK7H6g8+rMhyMtxjgXefzdEk2yKTdB3LCFdNMw4Ct+w@mail.gmail.com>

On 06.05.2021 08:35, Amit Langote wrote:
> On Wed, May 5, 2021 at 7:59 PM Pavel Luzanov 
> <p.luzanov@postgrespro.ru> wrote:
>> 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
> That makes sense, thanks for noticing. How about the attached? 

I like it.
Especially the link to the ALTER TABLE, this avoids duplication of all 
the nuances of the the DETACH .. CONCURRENTLY.

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






view thread (87+ messages)  latest in thread

Message-ID: <7b1ff3fb-2002-a09e-8e60-1b79086ac294@postgrespro.ru>
Permalink:  ../7b1ff3fb-2002-a09e-8e60-1b79086ac294@postgrespro.ru/
Also on:    postgresql.org/message-id/7b1ff3fb-2002-a09e-8e60-1b79086ac294@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: <7b1ff3fb-2002-a09e-8e60-1b79086ac294@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