Can I prevent my sequence to increment if an insert is rejected?

From: Frederic De Leersnijder <frederic(dot)de(dot)leersnijder(at)pandora(dot)be>
To: "pgsql-sql(at)hub(dot)org" <pgsql-sql(at)hub(dot)org>
Subject: Can I prevent my sequence to increment if an insert is rejected?
Date: 1999-07-20 16:54:11
Message-ID: 3794A9B3.C323DC4A@pandora.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

when I try to insert a record and it curses with fields with a unique
key on them my sequence I use for my primary key does increment. How can
I prevent this from happening?

Thanks
Frederic

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message tjk@tksoft.com 1999-07-20 19:01:34 Re: [SQL] Can I prevent my sequence to increment if an insert is rejected?
Previous Message Tom Lane 1999-07-20 14:53:39 Re: [SQL] bad select performance for where (x=1 or x=3)