Re: update ALTER TABLE with ATTACH PARTITION lock mode

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: update ALTER TABLE with ATTACH PARTITION lock mode
Date: 2019-10-31 08:00:11
Message-ID: CA+HiwqErNdjFY-PKLAmY78qkMG3bi5A2bvxgE2UNaokZF9wowA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

On Tue, Oct 29, 2019 at 12:13 AM Alvaro Herrera
<alvherre(at)2ndquadrant(dot)com> wrote:
> 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.

As someone who has written some of those lines, I agree that Justin's
tweaks make them more readable, so +1 to apply 0002 patch too.

Thanks,
Amit

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2019-10-31 08:18:46 Re: [PATCH] Do not use StdRdOptions in Access Methods
Previous Message Michael Paquier 2019-10-31 07:49:39 Re: [PATCH] Do not use StdRdOptions in Access Methods