Re: Need help understanding pg_locks

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>,"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Florian Pflug" <fgp(at)phlo(dot)org>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Need help understanding pg_locks
Date: 2011-07-11 16:04:27
Message-ID: 4E1AD8BB020000250003F1A3@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> OK, so as I understand it, in pg_locks:
>
> Column | Type | Modifiers
> --------------------+----------+-----------
> locktype | text |
> database | oid |
> relation | oid |
> page | integer |
> tuple | smallint |
> virtualxid | text |
> transactionid | xid |
> classid | oid |
> objid | oid |
> objsubid | smallint |
>
> virtualtransaction | text |
> pid | integer |
> mode | text |
> granted | boolean |
>
> It is the last four that are related to the "locking entity".

> vaguely represented the locked object.

I think more accurately:

Information about the lock requester:

virtualtransaction, pid

Information about what is being locked:

database, relation, page, tuple, virtualxid, transactionid, classid,
objid, objsubid (where NULL means "not applicable to this lock)

Information about the lock itself:

locktype, mode, granted

-Kevin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2011-07-11 16:14:25 Re: Full GUID support
Previous Message Peter Eisentraut 2011-07-11 15:58:20 remove README.mb.jp and README.mb.big5?