Serials.

From: Grant <grant(at)conprojan(dot)com(dot)au>
To: pgsql-sql(at)postgresql(dot)org
Subject: Serials.
Date: 2001-03-24 05:55:09
Message-ID: Pine.LNX.4.21.0103241549070.21933-100000@webster.conprojan.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 null
client_id | smallint | not null
booking_time | timestamp | not null
duration | float4 | not null
notes | text | not null
Index: bookings_pkey

=#

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2001-03-24 11:34:09 Re: Serials.
Previous Message datactrl 2001-03-24 04:43:04 how do I check if a temporary table exists?