Re: Concurrent ALTER SEQUENCE RESTART Regression

Michael Paquier <michael.paquier@gmail.com>

From: Michael Paquier <michael.paquier@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Jason Petersen <jason@citusdata.com>, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Date: 2017-04-27T07:06:55Z
Lists: pgsql-bugs, pgsql-hackers
On Thu, Apr 27, 2017 at 3:23 PM, Andres Freund <andres@anarazel.de> wrote:
> More fun:
>
> A: CREATE SEQUENCE someseq;
> A: BEGIN;
> A: ALTER SEQUENCE someseq MAXVALUE 10;
> B: SELECT nextval('someseq') FROM generate_series(1, 1000);
>
> => ignores maxvalue

Well, for this one that's because the catalog change is
transactional... I am not sure that using heap_inplace_update() would
make things better just to be compatible with previous versions.
-- 
Michael


Commits

  1. Make ALTER SEQUENCE, including RESTART, fully transactional.

  2. Modify sequence catalog tuple before invoking post alter hook.

  3. Use weaker locks when updating pg_subscription_rel

  4. Add pg_sequence system catalog

  5. Modify sequence state storage to eliminate dangling-pointer problem