On Tue, Sep 15, 2026 at 9:00 AM Ayush Tiwari <[email protected]> wrote:
> Hi, > > On Tue, 15 Sept 2026 at 12:19, Alexandre Felipe < > [email protected]> wrote: > > > > Trying to do something different today. > > > > Hunting bugs. > > > > Addressing an issue in `ALTER SEQUENCE` commands [1], by adding > > a missing lock when calling RelationSetNewRelfilenumber and being > > more accurate about the type of lock required in that function's > doc-comment. > > > > The change is sound, even if it is not the complete fix yet. > > I posted about the same bug on pgsql-bugs yesterday [2] (quoted below), > so maybe it is better to keep this in one thread. > Transaction conflict, my bad :( I tried locking at the RelationSetNewRelfilenumber() call first, but it > deadlocks. ALTER still holds ShareRowExclusiveLock while it waits for the > upgrade, and that conflicts with the RowExclusiveLock a scanning > transaction needs for nextval(): > Callers elsewhere, even in sequence.c, already lock before calling it, so acquiring a lock in RelationSetNewRelfilenumber will definitely deadlock. Regards, Alexandre >
