Re: dump the database data

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: dump the database data
Дата
Msg-id 20050708165229.GA86826@winnie.fuhr.org
обсуждение исходный текст
Ответ на dump the database data  (Tony Smith <quickcur@yahoo.com>)
Список 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/

В списке pgsql-general по дате отправления:

Предыдущее
От: Douglas McNaught
Дата:
Сообщение: Re: Why UPDATE gl SET gl.glnum = gl.glnum; cause error when UPDATE gl
Следующее
От: Mark Harrison
Дата:
Сообщение: anybody used ERWin with pg?