Skip site navigation (1) Skip section navigation (2)

deadlock using sequences?

From: lars hofhansl <lhofhansl(at)yahoo(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: deadlock using sequences?
Date: 2002-10-05 00:53:17
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgadmin-support

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


-- Lars

Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More

pgadmin-support by date

Next:From: Hubert depesz LubaczewskiDate: 2002-10-05 08:21:36
Subject: Re: Fast Deletion For Large Tables
Previous:From: Roland RobertsDate: 2002-10-04 17:35:31
Subject: Re: [GENERAL] Fast Deletion For Large Tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group