From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ludwig Lim <lud_nowhere_man@yahoo.com>
Cc: PostgreSQL Mailing List <pgsql-sql@postgresql.org>
Subject: Re: Locking that will delayed a SELECT
Date: Fri, 18 Oct 2002 14:03:12 -0400
Message-ID: <19055.1034964192@sss.pgh.pa.us> (raw)
In-Reply-To: <20021018150234.23205.qmail@web80305.mail.yahoo.com>
References: <20021018150234.23205.qmail@web80305.mail.yahoo.com>
Ludwig Lim <lud_nowhere_man@yahoo.com> writes:
> *** For clarification ***
> In the SQL command reference of PostgreSQL:
> in SELECT statement section :
> "The FOR UPDATE clause allows the SELECT
> statement to perform exclusive locking of selected
> rows"
Hmm. That is a misstatement: FOR UPDATE only locks the selected row(s)
against other updates (ie UPDATE, DELETE, SELECT FOR UPDATE), so it's
not "exclusive" in the usual sense of the word: readers can still see
the row. I'll fix that for 7.3, but meanwhile you might care to read
the 7.3 development docs' discussion of concurrency, which is (IMHO
anyway) more accurate than what was there before:
http://developer.postgresql.org/docs/postgres/mvcc.html
Note in particular that table-level locks and row-level locks are two
independent features. Updates acquire an appropriate table-level lock
and then acquire row locks on the rows they are updating.
regards, tom lane
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: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, lud_nowhere_man@yahoo.com
Subject: Re: Locking that will delayed a SELECT
In-Reply-To: <19055.1034964192@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox