Re: Problem with Auto Increment - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Problem with Auto Increment
Date
Msg-id 20021104124318.I11215-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Problem with Auto Increment  (Ben Kassel <kasselb@nswccd.navy.mil>)
List pgsql-sql
On Mon, 4 Nov 2002, Ben Kassel wrote:

> When I try to create a new row in this table and do not explicitly
> define a unique value for datadefindex I get the following error
> message:

>  More information : If I DROP the database, recreate it, and enter
> values into the table manually, the autoincrement works on this table.
> It seems that the problem arises after I reload the data into the table
> using the \i command on a file which was created using the pg_dump
> command.

Was that a data only dump that you were reloading? I'd guess that a data
only dump is assuming that you have/will set the sequence's next value
correctly yourself.  You might just try finding the max value and using
setval on the sequence to get the sequence in the right place.





pgsql-sql by date:

Previous
From: Ben Kassel
Date:
Subject: Problem with Auto Increment
Next
From: Larry Rosenman
Date:
Subject: Re: [GENERAL] Database Design tool