On Fri, Jul 08, 2005 at 09:03:47AM -0700, Tony Smith wrote:
>
> pg_dump -d ....
What's the complete command?
> In my dump file I found the insert statements
> something like:
>
> INSERT into user values(5, "George", 1);
> INSERT into user values(6, "Richard", 3);
> INSERT into user values(7, "Pete", 6);
>
> I create the same tables in another database and run
> the above insert statement, the data was inserted, but
> the seq of user is not updated, it is still pointed to
> one. What is wrong?
The INSERT statements don't update the sequence because they provide
a value for the serial column (really an integer column), so the
DEFAULT expression (a call to nextval()) isn't used. But somewhere
in the dump should be a SELECT statement that calls setval() to
update the sequence -- do you not see that?
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/