Re: duplicate key errors when restoring 8.4.0 database dump into 9.1.2

Поиск
Список
Период
Сортировка
От Culley Harrelson
Тема Re: duplicate key errors when restoring 8.4.0 database dump into 9.1.2
Дата
Msg-id CAAPtAvRfQ7810RTFLYZv7fqrotPJQ4pOKNXiF8qOFK+_8O501Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: duplicate key errors when restoring 8.4.0 database dump into 9.1.2  (Adrian Klaver <adrian.klaver@gmail.com>)
Ответы Re: duplicate key errors when restoring 8.4.0 database dump into 9.1.2
Список pgsql-general
There is not any data in the new database.  I have dropped the database, created the database and then piped in the backup every time.


On Fri, Dec 30, 2011 at 8:06 AM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
On Friday, December 30, 2011 7:49:31 am Culley Harrelson wrote:
> They are just your standard sql errors seen in the output of psql mydb <
> backup.sql
>
>
> ALTER TABLE
> ERROR:  could not create unique index "ht_user_pkey"
> DETAIL:  Key (user_id)=(653009) is duplicated.
>
> There is a unique index on user_id in the 8..4.0 system and, of course,
> only one record for 653009.
>

http://www.postgresql.org/docs/9.1/interactive/app-pgdump.html

When doing the pg_dump of the 8.4 database you might want to use the  -c option

"
-c
--clean

   Output commands to clean (drop) database objects prior to outputting the
commands for creating them. (Restore might generate some harmless errors.)

   This option is only meaningful for the plain-text format. For the archive
formats, you can specify the option when you call pg_restore.
"

My suspicion is that there is already data in the tables of the 9.1 server from
previous restore attempts.

--
Adrian Klaver
adrian.klaver@gmail.com

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: duplicate key errors when restoring 8.4.0 database dump into 9.1.2
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: How to get the time zone offset