Re: renumber table - Mailing list pgsql-general

From Scott Marlowe
Subject Re: renumber table
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: renumber table  (Steve Clark <[email protected]>)
Responses Re: renumber table
List pgsql-general
On Wed, Jun 18, 2008 at 3:50 PM, Steve Clark <[email protected]> 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.  :)

pgsql-general by date:

Previous
From: Steve Clark
Date:
Subject: Re: renumber table
Next
From: "Dave Lee"
Date:
Subject: Re: migrating from mysql: need to convert empty string to null