summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane2020-05-16 01:47:21 +0000
committerTom Lane2020-05-16 01:47:34 +0000
commit474e7da6485687425d216eda1685d7e530b24fd6 (patch)
treedaea35ff7255a2b0d2991e8d7298077216677e84 /src
parent1d3743023ef8fa665902e791b0d52e9a1ab419cb (diff)
Change locktype "speculative token" to "spectoken".
It's just weird that this name wasn't chosen to look like an identifier. The suspicion that it wasn't thought about too hard is reinforced by the fact that it wasn't documented in the pg_locks view (until I did so, a day or two back). Update, and add a comment reminding future adjusters of this array to fix the docs too. Do some desultory wordsmithing on various entries in the wait events tables. Discussion: https://postgr.es/m/24595.1589326879@sss.pgh.pa.us
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/lockfuncs.c7
-rw-r--r--src/test/isolation/expected/insert-conflict-specconflict.out10
-rw-r--r--src/test/isolation/specs/insert-conflict-specconflict.spec2
3 files changed, 11 insertions, 8 deletions
diff --git a/src/backend/utils/adt/lockfuncs.c b/src/backend/utils/adt/lockfuncs.c
index ecb1bf92ff7..e992d1bbfce 100644
--- a/src/backend/utils/adt/lockfuncs.c
+++ b/src/backend/utils/adt/lockfuncs.c
@@ -22,7 +22,10 @@
#include "utils/builtins.h"
-/* This must match enum LockTagType! */
+/*
+ * This must match enum LockTagType! Also, be sure to document any changes
+ * in the docs for the pg_locks view and for wait event types.
+ */
const char *const LockTagTypeNames[] = {
"relation",
"extend",
@@ -30,7 +33,7 @@ const char *const LockTagTypeNames[] = {
"tuple",
"transactionid",
"virtualxid",
- "speculative token",
+ "spectoken",
"object",
"userlock",
"advisory"
diff --git a/src/test/isolation/expected/insert-conflict-specconflict.out b/src/test/isolation/expected/insert-conflict-specconflict.out
index 9be5ccf55f0..ae361fbd03a 100644
--- a/src/test/isolation/expected/insert-conflict-specconflict.out
+++ b/src/test/isolation/expected/insert-conflict-specconflict.out
@@ -362,16 +362,16 @@ step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
WHERE
- locktype IN ('speculative token', 'transactionid')
+ locktype IN ('spectoken', 'transactionid')
AND pa.datname = current_database()
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;
application_namelocktype mode granted
-isolation/insert-conflict-specconflict-s1speculative tokenShareLock f
+isolation/insert-conflict-specconflict-s1spectoken ShareLock f
isolation/insert-conflict-specconflict-s1transactionid ExclusiveLock t
-isolation/insert-conflict-specconflict-s2speculative tokenExclusiveLock t
+isolation/insert-conflict-specconflict-s2spectoken ExclusiveLock t
isolation/insert-conflict-specconflict-s2transactionid ExclusiveLock t
step controller_unlock_2_4: SELECT pg_advisory_unlock(2, 4);
pg_advisory_unlock
@@ -384,7 +384,7 @@ step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
WHERE
- locktype IN ('speculative token', 'transactionid')
+ locktype IN ('spectoken', 'transactionid')
AND pa.datname = current_database()
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;
@@ -406,7 +406,7 @@ step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
WHERE
- locktype IN ('speculative token', 'transactionid')
+ locktype IN ('spectoken', 'transactionid')
AND pa.datname = current_database()
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;
diff --git a/src/test/isolation/specs/insert-conflict-specconflict.spec b/src/test/isolation/specs/insert-conflict-specconflict.spec
index 2572072c9e6..60283974915 100644
--- a/src/test/isolation/specs/insert-conflict-specconflict.spec
+++ b/src/test/isolation/specs/insert-conflict-specconflict.spec
@@ -64,7 +64,7 @@ step "controller_print_speculative_locks" {
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
WHERE
- locktype IN ('speculative token', 'transactionid')
+ locktype IN ('spectoken', 'transactionid')
AND pa.datname = current_database()
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;