pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bob Smith <bsmith@h-e.com>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Postgres locking
Date: Tue, 25 Feb 2003 16:55:57 -0800
Message-ID: <10995E4C-4925-11D7-8FCC-0003933DD370@h-e.com> (raw)


I'm trying to use select for update locks in Postgres.  When I do this:

   begin work;
   select data from table where key = 1 for update;

in two psql's running simultaneously, about half the time the second 
transaction blocks and waits for the first to end (which is what I want 
it to do), the other half the time I get this:

   ERROR:  XactLockTableWait: LockAcquire failed

and the transaction is aborted.  I can't find any pattern, if I do the 
same statements in the same order several times, it will be block one 
time and error the next apparently at random.  I also tried using LOCK 
TABLE and found the same basic problem, sometimes the second 
transaction will block, other times it will abort with:

   ERROR:  LockRelation: LockAcquire failed

Do I have a configuration problem?  Is this a bug in Postgres?  I'm 
still running 7.2.1, would upgrading to 7.3 fix this?

Thanks!

Bob Smith
Hammett & Edison, Inc.
bsmith@h-e.com




Message-ID: <10995E4C-4925-11D7-8FCC-0003933DD370@h-e.com>
Permalink:  ../10995E4C-4925-11D7-8FCC-0003933DD370@h-e.com/
Also on:    postgresql.org/message-id/10995E4C-4925-11D7-8FCC-0003933DD370@h-e.com

 · 

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: bsmith@h-e.com
  Subject: Re: Postgres locking
  In-Reply-To: <10995E4C-4925-11D7-8FCC-0003933DD370@h-e.com>

* 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