Re: Sequence (related) Problem

From: Neil Conway <neilc(at)samurai(dot)com>
To: "Ron St(dot)Pierre" <rstpierre(at)syscor(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Sequence (related) Problem
Date: 2002-11-27 22:11:11
Message-ID: 1038435071.3550.37.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2002-11-27 at 16:38, Ron St.Pierre wrote:
> 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 ;

Execute the CREATE SEQUENCE with the default start value, and then set
it to whatever you like using:

SELECT setval('my_seq', nextval('abc') + ...);

Cheers,

Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-11-27 22:31:18 Re: Two features left
Previous Message Jon Swinth 2002-11-27 22:06:25 Re: Two features left