回答編集履歴
2
微修正
test
CHANGED
@@ -70,9 +70,9 @@
|
|
70
70
|
|
71
71
|
|
72
72
|
|
73
|
-
```
|
73
|
+
```psql
|
74
74
|
|
75
|
-
SELECT l.pid,d.datname,l.locktype,relation::regclass,transactionid,l.mode,l.granted
|
75
|
+
> SELECT l.pid,d.datname,l.locktype,relation::regclass,transactionid,l.mode,l.granted
|
76
76
|
|
77
77
|
FROM pg_locks l LEFT JOIN pg_database d ON l.database = d.oid
|
78
78
|
|
@@ -108,9 +108,9 @@
|
|
108
108
|
|
109
109
|
|
110
110
|
|
111
|
-
```
|
111
|
+
```psql
|
112
112
|
|
113
|
-
SELECT l.pid,d.datname,l.locktype,relation::regclass,transactionid,l.mode,l.granted
|
113
|
+
> SELECT l.pid,d.datname,l.locktype,relation::regclass,transactionid,l.mode,l.granted
|
114
114
|
|
115
115
|
FROM pg_locks l LEFT JOIN pg_database d ON l.database = d.oid
|
116
116
|
|
@@ -156,9 +156,9 @@
|
|
156
156
|
|
157
157
|
|
158
158
|
|
159
|
-
```
|
159
|
+
```psql
|
160
160
|
|
161
|
-
SELECT l.pid,d.datname,l.locktype,relation::regclass,transactionid,l.mode,l.granted
|
161
|
+
> SELECT l.pid,d.datname,l.locktype,relation::regclass,transactionid,l.mode,l.granted
|
162
162
|
|
163
163
|
FROM pg_locks l LEFT JOIN pg_database d ON l.database = d.oid
|
164
164
|
|
@@ -184,9 +184,9 @@
|
|
184
184
|
|
185
185
|
hoge_pkey は index
|
186
186
|
|
187
|
-
```
|
187
|
+
```psql
|
188
188
|
|
189
|
-
select * from hoge_pkey;
|
189
|
+
> select * from hoge_pkey;
|
190
190
|
|
191
191
|
ERROR: "hoge_pkey" is an index
|
192
192
|
|
1
微修正
test
CHANGED
@@ -58,7 +58,11 @@
|
|
58
58
|
|
59
59
|
|
60
60
|
|
61
|
-
|
61
|
+
[pg_locks(原文)](https://www.postgresql.org/docs/9.6/view-pg-locks.html)
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
> Throughout running a transaction, a server process holds an exclusive lock on the transaction's virtual transaction ID. If a permanent ID is assigned to the transaction (which normally happens only if the transaction changes the state of the database), it also holds an exclusive lock on the transaction's permanent transaction ID until it ends. **When a process finds it necessary to wait specifically for another transaction to end, it does so by attempting to acquire share lock on the other transaction's ID (either virtual or permanent ID depending on the situation). That will succeed only when the other transaction terminates and releases its locks.**
|
62
66
|
|
63
67
|
|
64
68
|
|