Re: Optimistic concurrency control - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: Optimistic concurrency control
Date
Msg-id 20050113174422.B567@hermes.hilbert.loc
Whole thread Raw
In response to Optimistic concurrency control  ("Frank Millman" <frank@chagford.com>)
List pgsql-general
> MS SQL Server uses a 'timestamp' column to check if a row has
> been altered since it was read. The equivalent in PostgreSQL
> seems to be the system column 'xmin'. However, the notes say
> 'You do not really need to be concerned about these columns,
> just know they exist.' Is it ok to use xmin for this purpose,
It is. If you only need opportunistic locking within one
transaction you can simply rely on PG in serializable mode to
detect conflicts. However, if for various reasons you need to
detect data changes across transactions (eg. across
connections) then you need to use xmin. We do that in GnuMed
(http://www.gnumed.org) and it works nicely.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

pgsql-general by date:

Previous
From: Terry Lee Tucker
Date:
Subject: Re: Trace triggers
Next
From: Lonni J Friedman
Date:
Subject: allowing connections from additional hosts without a restart?