Re: Bug: Sequence generator insert - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: Bug: Sequence generator insert
Date
Msg-id 20031128213828.GA24904@wolff.to
Whole thread Raw
In response to Bug: Sequence generator insert  ("Burr, Colin" <CBurr@herald.com>)
List pgsql-sql
On Tue, Nov 25, 2003 at 18:37:41 -0500, "Burr, Colin" <CBurr@herald.com> wrote:
> 
> However, even though the new record failed to be inserted into the table,
> the sequence generator was still updated.
> 
> The sequence generator should only be updated if the record is successfully
> inserted into the table, and should not be updated if the insert fails.

That isn't how sequences work. If you need a sequence of numbers without
gaps then you need to use something else. Note that the something else
will need to have a way to let only one transaction at a time update
the counter which may be a performance problem.


pgsql-sql by date:

Previous
From: Rod Taylor
Date:
Subject: Re: rules and return values question
Next
From: Tom Lane
Date:
Subject: Re: explicit joins wrong planning