Search Postgresql Archives

serial grows on failed requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux