]> granicus.if.org Git - postgresql/commitdiff
Modify sequence catalog tuple before invoking post alter hook.
authorAndres Freund <andres@anarazel.de>
Thu, 1 Jun 2017 00:03:10 +0000 (17:03 -0700)
committerAndres Freund <andres@anarazel.de>
Thu, 1 Jun 2017 21:19:33 +0000 (14:19 -0700)
This seems to have been broken in the commit (1753b1b027035029) that
moved the sequence definition into pg_sequence.

Author: Andres Freund
Discussion: https://postgr.es/m/20170601000716.qxg7c46ukkiljjb3@alap3.anarazel.de
Backpatch: Bug is in master/v10 only

src/backend/commands/sequence.c

index 4a56f03e8b65df0e3a2c9536c99b62773244d286..7e85b69ab8fea68e7032a0416f287db21b3338a0 100644 (file)
@@ -490,12 +490,12 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt)
        if (owned_by)
                process_owned_by(seqrel, owned_by, stmt->for_identity);
 
+       CatalogTupleUpdate(rel, &seqtuple->t_self, seqtuple);
+
        InvokeObjectPostAlterHook(RelationRelationId, relid, 0);
 
        ObjectAddressSet(address, RelationRelationId, relid);
 
-       CatalogTupleUpdate(rel, &seqtuple->t_self, seqtuple);
-
        heap_close(rel, RowExclusiveLock);
        relation_close(seqrel, NoLock);