Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb01a4f6

Browse files
committed
Update README.tuplock
This file was documenting an older version of patch0ac5ad5; updateit to match what was really committedAuthor: Florian Pflug
1 parent43ac12c commitb01a4f6

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

‎src/backend/access/heap/README.tuplock

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,25 @@ do LockTuple as well, if there is any conflict, to ensure that they don't
3636
starve out waiting exclusive-lockers. However, if there is not any active
3737
conflict for a tuple, we don't incur any extra overhead.
3838

39-
We provide four levels of tuple locking strength: SELECT FOR KEY UPDATE is
40-
super-exclusive locking (used to delete tuples and more generally to update
41-
tuples modifying the values of the columns that make up the key of the tuple);
42-
SELECT FOR UPDATE is a standards-compliant exclusive lock; SELECT FOR SHARE
43-
implements shared locks; and finally SELECT FOR KEY SHARE is a super-weak mode
44-
that does not conflict with exclusive mode, but conflicts with SELECT FOR KEY
45-
UPDATE. This last mode implements a mode just strong enough to implement RI
46-
checks, i.e. it ensures that tuples do not go away from under a check, without
47-
blocking when some other transaction that want to update the tuple without
48-
changing its key.
39+
We provide four levels of tuple locking strength: SELECT FOR UPDATE obtains an
40+
exclusive lock which prevents any kind of modification of the tuple. This is
41+
the lock level that is implicitly taken by DELETE operations, and also by
42+
UPDATE operations if they modify any of the tuple's key fields. SELECT FOR NO
43+
KEY UPDATE likewise obtains an exclusive lock, but only prevents tuple removal
44+
and modifications which might alter the tuple's key. This is the lock that is
45+
implicitly taken by UPDATE operations which leave all key fields unchanged.
46+
SELECT FOR SHARE obtains a shared lock which prevents any kind of tuple
47+
modification. Finally, SELECT FOR KEY SHARE obtains a shared lock which only
48+
prevents tuple removal and modifications of key fields. This last mode
49+
implements a mode just strong enough to implement RI checks, i.e. it ensures
50+
that tuples do not go away from under a check, without blocking when some
51+
other transaction that want to update the tuple without changing its key.
4952

5053
The conflict table is:
5154

52-
KEYUPDATE UPDATE SHARE KEY SHARE
53-
KEYUPDATE conflict conflict conflict conflict
54-
UPDATE conflict conflict conflict
55+
UPDATENO KEY UPDATE SHARE KEY SHARE
56+
UPDATE conflict conflict conflict conflict
57+
NO KEY UPDATE conflict conflict conflict
5558
SHARE conflict conflict
5659
KEY SHARE conflict
5760

@@ -127,7 +130,7 @@ The following infomask bits are applicable:
127130
the member flags. If HEAP_XMAX_IS_MULTI is not set and HEAP_XMAX_LOCK_ONLY
128131
is set, then one of these *must* be set as well.
129132
Note there is no infomask bit for a SELECT FOR SHARE lock. Also there is no
130-
separate bit for a SELECT FOR KEY UPDATE lock; this is implemented by the
133+
separate bit for a SELECT FORNOKEY UPDATE lock; this is implemented by the
131134
HEAP_KEYS_UPDATED bit.
132135

133136
- HEAP_KEYS_UPDATED

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp