Re: INSERT/UPDATEs cycles and lack of phantom locking

From: Florian Weimer <fweimer(at)bfk(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: INSERT/UPDATEs cycles and lack of phantom locking
Date: 2006-07-20 07:31:16
Message-ID: 823bcw20mz.fsf@mid.bfk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

* Florian Weimer:

> In addition, it occurred to me that I get the INSERT failure only if
> there is a suitable PRIMARY KEY/UNIQUE constraint on the table. I
> haven't got that in all cases, so I need that advisory locking anyway,

It seems that LOCK TABLE ... IN EXCLUSIVE MODE does exactly what I
need: it locks out itself (and write access), but not read access to
the table. And deadlocks are detected as well. Yay!

--
Florian Weimer <fweimer(at)bfk(dot)de>
BFK edv-consulting GmbH http://www.bfk.de/
Durlacher Allee 47 tel: +49-721-96201-1
D-76131 Karlsruhe fax: +49-721-96201-99

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message John Tregea 2006-07-20 11:52:24 Re: Storing encrypted data?
Previous Message Ross Johnson 2006-07-20 02:37:14 Re: Multi-table insert using RULE - how to handle id?