Re: pgsql: Ensure correct lock level is used in ALTER ... RENAME - Mailing list pgsql-committers

From Michael Paquier
Subject Re: pgsql: Ensure correct lock level is used in ALTER ... RENAME
Date
Msg-id YW/MYdSRQZtPFBWR@paquier.xyz
Whole thread Raw
In response to pgsql: Ensure correct lock level is used in ALTER ... RENAME  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: pgsql: Ensure correct lock level is used in ALTER ... RENAME  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-committers
Hi Alvaro,

On Tue, Oct 19, 2021 at 10:11:24PM +0000, Alvaro Herrera wrote:
> Ensure correct lock level is used in ALTER ... RENAME
>
> Commit 1b5d797cd4f7 intended to relax the lock level used to rename
> indexes, but inadvertently allowed *any* relation to be renamed with a
> lowered lock level, as long as the command is spelled ALTER INDEX.
> That's undesirable for other relation types, so retry the operation with
> the higher lock if the relation turns out not to be an index.
>
> After this fix, ALTER INDEX <sometable> RENAME will require access
> exclusive lock, which it didn't before.

hippopotamus and jay are complaining that this commit has introduced a
test with ordering issues:
 ORDER BY relation::regclass::text;
             relation            |        mode
 --------------------------------+---------------------
- alter_idx_rename_test_2        | AccessExclusiveLock
  alter_idx_rename_test_parted_2 | AccessExclusiveLock
+ alter_idx_rename_test_2        | AccessExclusiveLock
 (2 rows)

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hippopotamus&dt=2021-10-19%2023%3A43%3A14
--
Michael

Attachment

pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Fix build of MSVC with OpenSSL 3.0.0
Next
From: Alvaro Herrera
Date:
Subject: Re: pgsql: Ensure correct lock level is used in ALTER ... RENAME