Re: What's the best way to deal with the pk_seq sequence value after a restore (bulk loading)?

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: "Wang\, Mary Y" <mary(dot)y(dot)wang(at)boeing(dot)com>
Cc: "pgsql-general\(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: What's the best way to deal with the pk_seq sequence value after a restore (bulk loading)?
Date: 2010-03-06 20:37:44
Message-ID: m26359fap3.fsf@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Wang, Mary Y" <mary(dot)y(dot)wang(at)boeing(dot)com> writes:
> Because the current value is 6818, during the restore process, it
> complained about "duplicate key value violates unique constraint
> "bug_pkey, because the value of bug_pk_seq for a insert has been
> already been used. So what is the best way to resolve this? Should I
> set the value for bug_pk_seq to be 1 in the beginning of the dump
> file?
>
> Any suggestions?

See the following article:

http://tapoueh.org/articles/blog/_Resetting_sequences._All_of_them,_please!.html

Regards,
--
dim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-03-06 21:37:56 Re: What's the best way to deal with the pk_seq sequence value after a restore (bulk loading)?
Previous Message Wang, Mary Y 2010-03-06 19:01:08 Re: What's the best way to deal with the pk_seq sequence value after a restore (bulk loading)?