Re: dump the database data

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tony Smith <quickcur(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: dump the database data
Date: 2005-07-08 16:52:29
Message-ID: 20050708165229.GA86826@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mark Harrison 2005-07-08 16:58:55 anybody used ERWin with pg?
Previous Message Douglas McNaught 2005-07-08 16:25:05 Re: Why UPDATE gl SET gl.glnum = gl.glnum; cause error when UPDATE gl