public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Alvaro Herrera <[email protected]>
Cc: Merlin Moncure <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: [HACKERS] pg_locks view and user locks
Date: Mon, 13 Sep 2004 17:31:15 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

Alvaro Herrera <[email protected]> writes:
> ISTM it would be better to have pg_locks show only system locks, and
> another view, say pg_userlocks, to show user locks.  This would allow to
> show different data; for example, the PID of the process involved.

I think this is a bad idea, at least for the base-level view, because it
would imply that it's impossible to get a truly simultaneous view of the
state of all the locks.  It would certainly be a bad idea to so separate
xact and table locks.  I'd prefer to extend the present approach and add
columns that are NULL when the type of lock isn't relevant to them.

> Another option would be to add another column to pg_locks to say what
> lockmethod (1 for system, 2 for user) is used in each lock.

How about a text column with values "TABLE", "XACT", "USER"?

			regards, tom lane




view thread (6+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [HACKERS] pg_locks view and user locks
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox