Re: dump the database data - Mailing list pgsql-general

From Michael Fuhr
Subject Re: dump the database data
Date
Msg-id 20050708171935.GA1828@winnie.fuhr.org
Whole thread Raw
In response to Re: dump the database data  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
[Please copy the mailing list on replies so others can contribute
to and learn from the discussion.]

On Fri, Jul 08, 2005 at 09:59:35AM -0700, Tony Smith wrote:
> no, I did not see it. The insert is INSERT into user
> values(5, "George", 1); My dump command is
>
> pg_dump -d databaseName
>
> There maybe more options for username, password. But
> nothing else. Is there any options in the pg_dump
> could fix this?

What version of PostgreSQL are you using?  I just tested 7.2.8,
7.3.10, 7.4.8, 8.0.3, and 8.1devel, and pg_dump from all of them
emitted a setval() to update the sequence.  The line should resemble
one of the following, depending on the version:

SELECT setval ('"user_id_seq"', 7, true);
SELECT pg_catalog.setval('user_id_seq', 7, true);
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('"user"', 'id'), 7, true);

Did you do a visual search or did you use a command like
"grep setval filename"?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: anybody used ERWin with pg?
Next
From: Michael Fuhr
Date:
Subject: Re: Postgresql 7.4.8 inconsistent index usage