deadlock using sequences?

From: Lars <lhofhansl(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: deadlock using sequences?
Date: 2002-10-05 09:31:43
Message-ID: 3D9EB17F.1030705@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

(Accidently posted to pgadmin-support.)

Hi,

I get occasional deadlocks when using sequences from
multiple clients.

Here's the table DDL:

create sequence ids;
create table foo( id integer default nextval('ids'),
parent integer, type char(4), name text, value text )
without oids;
create index xml_id on xml(id);

I'm inserting 1000s of tuples from 4-5 different
clients (all use JDBC but are single threaded).
About once every 1000 tuples I get

ERROR: deadlock detected

I can't use OIDS because I have to guarantee
monotonically increasing ids.

Any ideas? Shouldn't sequences be implemented deadlock
free?

Thanks.

-- Lars

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carfield Yim 2002-10-05 09:38:25 Re: Error after updating postgresql
Previous Message Hubert depesz Lubaczewski 2002-10-05 08:21:36 Re: Fast Deletion For Large Tables