Re: update ALTER TABLE with ATTACH PARTITION lock mode - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: update ALTER TABLE with ATTACH PARTITION lock mode
Date
Msg-id 20191028150644.GA18688@alvherre.pgsql
Whole thread Raw
In response to Re: update ALTER TABLE with ATTACH PARTITION lock mode  (Michael Paquier <michael@paquier.xyz>)
Responses Re: update ALTER TABLE with ATTACH PARTITION lock mode (docs)
Re: update ALTER TABLE with ATTACH PARTITION lock mode
List pgsql-hackers
On 2019-Oct-28, Michael Paquier wrote:

> On Sun, Oct 27, 2019 at 07:12:07PM -0500, Justin Pryzby wrote:
> > commit #898e5e32 (Allow ATTACH PARTITION with only ShareUpdateExclusiveLock)
> > updates ddl.sgml but not alter_table.sgml, which only says:
> > 
> > https://www.postgresql.org/docs/12/release-12.html
> > |An ACCESS EXCLUSIVE lock is held unless explicitly noted.
> 
> +     <para>
> +      Attaching a partition acquires a <literal>SHARE UPDATE EXCLUSIVE</literal>
> +      lock on the partitioned table, in addition to an
> +      <literal>ACCESS EXCLUSIVE</literal> lock on the partition.
> +     </para>
> Updating the docs of ALTER TABLE sounds like a good idea.  This
> sentence looks fine to me.  Perhaps others have suggestions?

Doesn't the command also acquire a lock on the default partition if
there is one?  It sounds worth noting.

> > Find attached patch, which also improve language in several related places.
> 
> Not sure that these are actually improvements.

I think some of them (most?) are clear improvements.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Shay Rojansky
Date:
Subject: strpos behavior change around empty substring in PG12
Next
From: Tom Lane
Date:
Subject: Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'