serial grows on failed requests

Поиск
Список
Период
Сортировка
От rihad
Тема serial grows on failed requests
Дата
Msg-id 46C57DBE.3000307@mail.ru
обсуждение исходный текст
Ответы Re: serial grows on failed requests
Список pgsql-general
Hi, my table is defined as:
CREATE TABLE users (
     id integer NOT NULL,
...
);

CREATE SEQUENCE users_id_seq
     INCREMENT BY 1
     NO MAXVALUE
     NO MINVALUE
     CACHE 1;

ALTER SEQUENCE users_id_seq OWNED BY users.id;

Although it's just a more verbose way to say
create table users (id serial primary key);
:)

When I do an insert that fails (like FK inconsistency, illegal value,
etc.) the users.id grows nonetheless... This is unacceptable for my
current needs. Any way to prevent that while still maintaining ease of
use? Using PostgreSQL 8.2.4

Thanks.

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: [RESEND] Transaction auto-abort causes grief with Spring Framework
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: serial grows on failed requests