gpt4 book ai didi

postgresql - 当发生死锁时,postgres 日志文件中的 "tuple (0,79)"是什么意思?

转载 作者:行者123 更新时间:2023-11-29 11:17:33 25 4
gpt4 key购买 nike

在 postgres 日志中:

2016-12-23 15:28:14 +07 [17281-351 trns: 4280939, vtrns: 3/20] postgres@deadlocks HINT:  See server log for query details.
2016-12-23 15:28:14 +07 [17281-352 trns: 4280939, vtrns: 3/20] postgres@deadlocks CONTEXT: while locking tuple (0,79) in relation "account"
2016-12-23 15:28:14 +07 [17281-353 trns: 4280939, vtrns: 3/20] postgres@deadlocks STATEMENT: SELECT id FROM account where id=$1 for update;

当我引发死锁时,我可以看到文本:tuple (0,79)

据我所知,一个元组就是表中的几行。但是我不明白 (0,79) 是什么意思。我的table account只有2行,只是玩和自学的应用。

那么 (0,79) 是什么意思呢?

最佳答案

This is the data type of the system column ctid. A tuple ID is a pair (block number, tuple index within block) that identifies the physical location of the row within its table.

阅读https://www.postgresql.org/docs/current/static/datatype-oid.html

表示 block 号0,行索引79

另请阅读 http://rachbelaid.com/introduction-to-postgres-physical-storage/

还运行 SELECT id,ctid FROM account where id=$1 并使用正确的 $1 来检查...

关于postgresql - 当发生死锁时,postgres 日志文件中的 "tuple (0,79)"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41299744/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com