Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lock Table

0 views
Skip to first unread message

Enzo Campanella

unread,
Sep 16, 2009, 9:29:26 AM9/16/09
to
Hello.

Let me know if you can know if a table is locked by a lock
Type:
Begin Work
Lock Table MySchema.MyTable IN ACCESS EXCLUSIVE MODE
....
Unlock Table or Commit

For example:
select * from islock(TableName)
Thanks
Enzo

Original Message:

Ciao.

Vorrei sapere se � possibile sapere se una tabella � bloccata da un Lock
del tipo:
Begin Work
Lock table MySchema.MyTable IN ACCESS EXCLUSIVE MODE
....
Unlock Table o Commit

per esempio:
select * from islock(tablename)

Grazie
Enzo

Enzo Campanella

unread,
Sep 16, 2009, 10:13:21 AM9/16/09
to
Thanks to all.
I found the solution:

SELECT pg_class.relname, pg_database.datname, transactionid, pid, mode,
granted
FROM pg_locks, pg_class, pg_database
WHERE pg_locks.relation = pg_class.oid
AND pg_locks.database = pg_database.oid and relname='MyTable'

Enzo.

0 new messages