Sequence (related) Problem

From: "Ron St(dot)Pierre" <rstpierre(at)syscor(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Sequence (related) Problem
Date: 2002-11-27 21:38:54
Message-ID: OXaF9.119079$ka.2812272@news1.calgary.shaw.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)syscor(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Luc Lachance 2002-11-27 21:45:34 Re: Two features left
Previous Message Jon Swinth 2002-11-27 21:23:52 Re: Two features left