Re: Serials.

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Grant <grant(at)conprojan(dot)com(dot)au>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Serials.
Date: 2001-03-24 14:29:49
Message-ID: Pine.LNX.4.30.0103241526220.2319-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Grant writes:

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

Because that's what a four-byte signed integer takes. No one has stepped
forward to implement 8-byte sequence counters, yet.

> (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

Why did you reset the sequence in the first place? You should probably
set it back to where it was (using setval()). Sequences simply return
incrementing numbers, they don't fill holes or have any
constraint-avoiding logic.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

  • Serials. at 2001-03-24 05:55:09 from Grant

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Perrin 2001-03-24 16:16:16 all views in database broken at once
Previous Message Mathijs Brands 2001-03-24 13:49:14 Re: Serials.