By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,302 Members | 1,185 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,302 IT Pros & Developers. It's quick & easy.

Row Lock? Who?

P: n/a
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
Share this Question
Share on Google+
1 Reply

P: n/a
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.