Serials: removing the holes? (consecutive)

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Serials: removing the holes? (consecutive)
Date: 2002-08-03 01:44:31
Message-ID: 3D4B357F.1070704@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Serials are a great datatype but when using them you sometimes get
non-consecutive numbers. I understand some of the reasons for this.

Is there a (simple) way to re-sequence a serial column that is the
primary key for a table so that the numbers are all consecutive?

I don't mnind having holes but once in a while I'd like to re-sequence
the table so that the current numbes in use become consecutive.

Just asking ...

Thanks!

Jc

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-08-03 01:49:39 Re: encrypted data types?
Previous Message Jean-Christian Imbeault 2002-08-03 01:38:40 encrypted data types?