gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] Re: Gnumed-devel Digest, Vol 3, Issue 29


From: Horst Herb
Subject: Re: [Gnumed-devel] Re: Gnumed-devel Digest, Vol 3, Issue 29
Date: Tue, 25 Feb 2003 08:59:06 +0100
User-agent: KMail/1.5

On Mon, 24 Feb 2003 10:34 pm, sjtan wrote:

>  is 'select for update' a new sql feature to distinguish a read only
> transaction, from a read-write transaction?
> How does it work?

It is a very old feature. I qute from the postgres version 6.5 documentation:
"""
However, take into account that SELECT FOR UPDATE will modify selected rows to 
mark them and so will results in disk writes.

Row-level locks don't affect data querying. They are used to block writers to 
the same row only. 
"""

It is simple:
begin transaction;
select column_to_change from _table_to change for update;

...

now, until the transaction is finished, nobody else can write to that column, 
but everybody can *read* the previous unmodified state until the transaction 
is completed.

Horst





reply via email to

[Prev in Thread] Current Thread [Next in Thread]