Sequence (related) Problem - Mailing list pgsql-general

From Ron St.Pierre
Subject Sequence (related) Problem
Date
Msg-id OXaF9.119079$ka.2812272@news1.calgary.shaw.ca
Whole thread Raw
Responses Re: Sequence (related) Problem  (Neil Conway <neilc@samurai.com>)
List pgsql-general
I am migrating a DB from Access to postgreSQL and am making quite a few
changes to it including renaming tables, columns, sequences, etc.

I am renaming TBLOLD to TBLNEW and consequently need to rename the
sequence from TBLOLD_ID_SEQ to TBLNEW_ID_SEQ. I also want it to START at
a value just above TBLOLD's last value. To set the start value of the
new sequence I am trying:

     CREATE SEQUENCE 'tblnew_id_seq' start nextval('tblold_id_deq')
increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
as well as many variations of the above (including using SELECT to get
the nextval).

Could someone please point me to a solution?

Thanks

--
Ron St.Pierre
Syscor R&D
tel: 250-361-1681
email: rstpierre@syscor.com



pgsql-general by date:

Previous
From: Jon Swinth
Date:
Subject: Re: Two features left
Next
From: Jean-Luc Lachance
Date:
Subject: Re: Two features left