470,647 Members | 1,056 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

Row Lock? Who?

If a row of data has been locked FOR UPDATE, how can one determine WHO has
it locked?

--
Hal Davison
Davison Consulting
Jul 19 '05 #1
1 3639
Hal Davison wrote:
If a row of data has been locked FOR UPDATE, how can one determine WHO has
it locked?

I don't know think that you can easily tell who has it locked. The
pg_locks view gives the following:
relation | database | transaction | pid | mode | granted
----------+----------+-------------+------+-----------------+---------
| | 9313511 | 1347 | ExclusiveLock | t
18367616 | 17474206 | | 1351 | AccessShareLock | t
| | 9300513 | 1553 | ExclusiveLock | t
...
which gives you the pid, which you could use to see who it is.

hth
Ron

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by xixi | last post: by
reply views Thread by Bruce Pullen | last post: by
7 posts views Thread by Sunny | last post: by
3 posts views Thread by Invalid | last post: by
reply views Thread by Nashat Wanly | last post: by
3 posts views Thread by Raj | last post: by
190 posts views Thread by blangela | last post: by
94 posts views Thread by Samuel R. Neff | last post: by
1 post views Thread by Korara | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.