Re: renumber table

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Steve Clark" <sclark(at)netwolves(dot)com>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: renumber table
Date: 2008-06-18 21:53:09
Message-ID: dcc563d10806181453q779b9a02oa5f16d10d87d9260@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jun 18, 2008 at 3:50 PM, Steve Clark <sclark(at)netwolves(dot)com> wrote:
>
> I realize this is certainly not the best design - but at this point in time
> it can't be changed. The table
> is rarely updated and never concurrently and is very small, typically less
> than 100 rows so there really is
> no performance impact.

Then the easiest way to renumber a table like that is to do something like:

create temp sequence myseq;
update table set idfield=nextval('myseq');

and hit enter.
and pray. :)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Lee 2008-06-19 00:31:45 Re: migrating from mysql: need to convert empty string to null
Previous Message Steve Clark 2008-06-18 21:50:11 Re: renumber table