Skip to content

Commit e8e44e8

Browse files
committed
Move new LOCKTAG_DATABASE_FROZEN_IDS to end of enum LockTagType.
Several PGXN modules reference LockTagType values; renumbering would force a recompile of those modules. Oversight in back-patch of today's commit 566372b. Back-patch to released branches, v12 through 9.5. Reported by Tom Lane. Discussion: https://postgr.es/m/921383.1597523945@sss.pgh.pa.us
1 parent e525770 commit e8e44e8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/backend/utils/adt/lockfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
const char *const LockTagTypeNames[] = {
2727
"relation",
2828
"extend",
29-
"frozenid",
3029
"page",
3130
"tuple",
3231
"transactionid",
3332
"virtualxid",
3433
"speculative token",
3534
"object",
3635
"userlock",
37-
"advisory"
36+
"advisory",
37+
"frozenid"
3838
};
3939

4040
/* This must match enum PredicateLockTargetType (predicate_internals.h) */

src/include/storage/lock.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ typedef enum LockTagType
141141
/* ID info for a relation is DB OID + REL OID; DB OID = 0 if shared */
142142
LOCKTAG_RELATION_EXTEND, /* the right to extend a relation */
143143
/* same ID info as RELATION */
144-
LOCKTAG_DATABASE_FROZEN_IDS, /* pg_database.datfrozenxid */
145-
/* ID info for frozen IDs is DB OID */
146144
LOCKTAG_PAGE, /* one page of a relation */
147145
/* ID info for a page is RELATION info + BlockNumber */
148146
LOCKTAG_TUPLE, /* one physical tuple */
@@ -162,10 +160,12 @@ typedef enum LockTagType
162160
* Also, we use DB OID = 0 for shared objects such as tablespaces.
163161
*/
164162
LOCKTAG_USERLOCK, /* reserved for old contrib/userlock code */
165-
LOCKTAG_ADVISORY /* advisory user locks */
163+
LOCKTAG_ADVISORY, /* advisory user locks */
164+
LOCKTAG_DATABASE_FROZEN_IDS /* pg_database.datfrozenxid */
165+
/* ID info for frozen IDs is DB OID */
166166
} LockTagType;
167167

168-
#define LOCKTAG_LAST_TYPE LOCKTAG_ADVISORY
168+
#define LOCKTAG_LAST_TYPE LOCKTAG_DATABASE_FROZEN_IDS
169169

170170
extern const char *const LockTagTypeNames[];
171171

0 commit comments

Comments
 (0)