On Sat, 2003-08-30 at 09:01, Rod Taylor wrote:
> > i was hoping there was some trickery with sequences that would allow me to 
> > easily pick a random valid sequence number..?
> 
> I would suggest renumbering the data.
> 
> ALTER SEQUENCE ... RESTART WITH 1;
> UPDATE table SET pkey = DEFAULT;
> 
> Of course, PostgreSQL may have trouble with that update due to
> evaluation of the unique constraint immediately -- so drop the primary
> key first, and add it back after.

And if there are child tables, they'd all have to be updated, too.

-- 
-----------------------------------------------------------------
Ron Johnson, Jr. [EMAIL PROTECTED]
Jefferson, LA USA

"Whatever may be the moral ambiguities of the so-called 
demoratic nations and however serious may be their failure to 
conform perfectly to their democratic ideals, it is sheer moral 
perversity to equate the inconsistencies of a democratic 
civilization with the brutalities which modern tyrannical states
practice."
Reinhold Nieburhr, ca. 1940


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to