setting next value of an established sequence

Lists: pgsql-novice
From: glenn <gdavy(at)tpg(dot)com(dot)au>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: setting next value of an established sequence
Date: 2003-09-03 05:07:35
Message-ID: 1062565654.3083.10.camel@odin.valhalla
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Hi all
I've imported data into an established database. The data is, off
course, held together by various keys (which don't duplicate any of the
few existing values we have).

Is it possible for me to change the nextvalue stored in the sequences to
one that is more appropriate for (i.e. next after) the imported data?

Glenn


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: glenn <gdavy(at)tpg(dot)com(dot)au>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: setting next value of an established sequence
Date: 2003-09-03 05:11:02
Message-ID: 9899.1062565862@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

glenn <gdavy(at)tpg(dot)com(dot)au> writes:
> Is it possible for me to change the nextvalue stored in the sequences

Sure, see setval().

regards, tom lane