Concurrency and locks - Mailing list pgsql-general

From Mike Mascari
Subject Concurrency and locks
Date
Msg-id 006601c2d836$2e8cacc0$0102a8c0@mascari.com
Whole thread Raw
Responses Re: Concurrency and locks  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Is it possible, or could it be made possible in the future, for
a ROW locking mechanism whereby:

Transaction #1

BEGIN;
SELECT key FROM foo WHERE key = 1 FOR ????;

 returns immediately with '1'

Transaction #2

BEGIN;
SELECT key FROM foo WHERE key = 1 FOR ????;

 returns immediately with '1' <-- Not blocked by #1

Transaction #3

BEGIN;
UPDATE foo SET key = 2 WHERE key = 1; <-- Blocks

If one wants to guarantee consistency in user-defined BEFORE
INSERT/UPDATE triggers and trigger procedures, at the moment, is
the only recourse SELECT FOR UPDATE? Is this the cause of
performance problems with the current RI implementation?

Mike Mascari
mascarm@mascari.com



pgsql-general by date:

Previous
From: Guy Fraser
Date:
Subject: Has the attribute name for oid changed in pgsql 7.3 ?
Next
From: Greg Copeland
Date:
Subject: Re: Table Partitioning in Postgres: