pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Florian Weimer <fweimer@bfk.de>
To: pgsql-sql@postgresql.org
Subject: Re: INSERT/UPDATEs cycles and lack of phantom locking
Date: Thu, 20 Jul 2006 09:31:16 +0200
Message-ID: <823bcw20mz.fsf@mid.bfk.de> (raw)
In-Reply-To: <827j291vo9.fsf@mid.bfk.de>
References: <82zmf60zf4.fsf@mid.bfk.de>
	<25634.1153319178@sss.pgh.pa.us>
	<827j291vo9.fsf@mid.bfk.de>

* 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@bfk.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



view thread (4+ messages)

Message-ID: <823bcw20mz.fsf@mid.bfk.de>
Permalink:  ../823bcw20mz.fsf@mid.bfk.de/
Also on:    postgresql.org/message-id/823bcw20mz.fsf@mid.bfk.de

 · 

reply

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: fweimer@bfk.de
  Subject: Re: INSERT/UPDATEs cycles and lack of phantom locking
  In-Reply-To: <823bcw20mz.fsf@mid.bfk.de>

* 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