Search Postgresql Archives

Re: a SELECT FOR UPDATE question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 08, 2005 at 12:58:34AM -0500, Tom Lane wrote:
> Michael Fuhr <mike@xxxxxxxx> writes:
> > 
> > I think you can infer that a process is working with a row in some
> > manner (UPDATE, SELECT FOR UPDATE) by looking at the row's xmax
> > column and checking pg_locks to see if any process is holding a
> > lock on the indicated transaction ID.
> 
> I'm too tired to work out an example, but I think this probably doesn't
> work in general: the xmax on the version of the row you can see might
> not correspond to a live transaction, but that doesn't mean someone
> else doesn't hold a lock on the latest committed version of the row.

Okay...I had done some tests with UPDATE and SELECT FOR UPDATE and
observed what I wrote, but admittedly that covers only a few cases.
If you could point me in the right direction I'll try to work out
an example where my suggestion fails.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux