Serials. - Mailing list pgsql-sql

From Grant
Subject Serials.
Date
Msg-id Pine.LNX.4.21.0103241549070.21933-100000@webster.conprojan.com.au
Whole thread Raw
Responses Re: Serials.  (darcy@druid.net (D'Arcy J.M. Cain))
Re: Serials.  (Mathijs Brands <mathijs@ilse.nl>)
Re: Serials.  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-sql
Please see below for my table schema. I have two questions.

(1) Why is a sequence limited to 2147483647, it seems very small?

(2) If I reset the sequence, then try another insert. It will not insert
anything until it cycles through all sequences and finds an unused one. It
will give the following error each time it tries to insert a row with a
used sequence:

PostgreSQL query failed: ERROR: Cannot insert a duplicate key into unique
index releases_pkey 

How can I possibly get around this issue so that I can be sure to always
have a free id without getting the error above?

Thankyou.

-- TABLE --

=# \d bookings                              Table "bookings" Attribute   |   Type    |                     Modifier
--------------+-----------+---------------------------------------------------id           | integer   | not null
default
nextval('bookings_id_seq'::text)added        | timestamp | not nullclient_id    | smallint  | not nullbooking_time |
timestamp| not nullduration     | float4    | not nullnotes        | text      | not null
 
Index: bookings_pkey

=#



pgsql-sql by date:

Previous
From: "datactrl"
Date:
Subject: how do I check if a temporary table exists?
Next
From: Richard H
Date:
Subject: Re: rows equal