2016-12-23 52 views
4

Postgres裏的日誌:postgres日誌文件中的「元組(0,79)」是指什麼時候發生死鎖?

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

當我挑起了僵局,我可以看到的文字:tuple (0,79)

據我所知,一個元組只有幾行在表中。但我不明白(0,79)是什麼意思。我在桌面帳戶中只有2行,它只是播放和自學應用程序。

那麼(0,79)是什麼意思?

+1

元組是由多個列組成的**單行**行。一個有兩行的表有兩個元組。 –

回答

4

這是系統列ctid的數據類型。元組ID是一對 (塊號,塊內的元組索引),用於標識其表中該行的物理位置 。

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

這意味着塊號0,行索引79

也讀http://rachbelaid.com/introduction-to-postgres-physical-storage/

也運行SELECT id,ctid FROM account where id=$1$1簽出...

+0

是的,在postgres資源中發現:https://github.com/postgres/postgres/blob/55c3391d1e6a201b5b891781d21fe682a8c64fe6/src/backend/storage/lmgr/lmgr.c#L725 – Hayate

相關問題