]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Move new LOCKTAG_DATABASE_FROZEN_IDS to end of enum LockTagType.
authorNoah Misch <noah@leadboat.com>
Sat, 15 Aug 2020 23:15:59 +0000 (16:15 -0700)
committerNoah Misch <noah@leadboat.com>
Sat, 15 Aug 2020 23:16:29 +0000 (16:16 -0700)
Several PGXN modules reference LockTagType values; renumbering would
force a recompile of those modules.  Oversight in back-patch of today's
commit 566372b3d6435639e4cc4476d79b8505a0297c87.  Back-patch to released
branches, v12 through 9.5.

Reported by Tom Lane.

Discussion: https://postgr.es/m/921383.1597523945@sss.pgh.pa.us

src/backend/utils/adt/lockfuncs.c
src/include/storage/lock.h

index 4ed5bf15f9e2bfc8b23541c7f05252e94f1309f1..b39b824ed750b4918973997c3c5fa7629a040d18 100644 (file)
@@ -26,7 +26,6 @@
 const char *const LockTagTypeNames[] = {
        "relation",
        "extend",
-       "frozenid",
        "page",
        "tuple",
        "transactionid",
@@ -34,7 +33,8 @@ const char *const LockTagTypeNames[] = {
        "speculative token",
        "object",
        "userlock",
-       "advisory"
+       "advisory",
+       "frozenid"
 };
 
 /* This must match enum PredicateLockTargetType (predicate_internals.h) */
index cf1bed6ea4c15cb079b5014958f426b26d1ed7f8..5d1d2763bc8ba9f31b3eea58aa59cfba8722b67b 100644 (file)
@@ -141,8 +141,6 @@ typedef enum LockTagType
        /* ID info for a relation is DB OID + REL OID; DB OID = 0 if shared */
        LOCKTAG_RELATION_EXTEND,        /* the right to extend a relation */
        /* same ID info as RELATION */
-       LOCKTAG_DATABASE_FROZEN_IDS,    /* pg_database.datfrozenxid */
-       /* ID info for frozen IDs is DB OID */
        LOCKTAG_PAGE,                           /* one page of a relation */
        /* ID info for a page is RELATION info + BlockNumber */
        LOCKTAG_TUPLE,                          /* one physical tuple */
@@ -162,10 +160,12 @@ typedef enum LockTagType
         * Also, we use DB OID = 0 for shared objects such as tablespaces.
         */
        LOCKTAG_USERLOCK,                       /* reserved for old contrib/userlock code */
-       LOCKTAG_ADVISORY                        /* advisory user locks */
+       LOCKTAG_ADVISORY,                       /* advisory user locks */
+       LOCKTAG_DATABASE_FROZEN_IDS     /* pg_database.datfrozenxid */
+       /* ID info for frozen IDs is DB OID */
 } LockTagType;
 
-#define LOCKTAG_LAST_TYPE      LOCKTAG_ADVISORY
+#define LOCKTAG_LAST_TYPE      LOCKTAG_DATABASE_FROZEN_IDS
 
 extern const char *const LockTagTypeNames[];