Re: [HACKERS] pg_restore failed for foreign key constraint

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] pg_restore failed for foreign key constraint
Дата
Msg-id 21358.1500300213@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [HACKERS] pg_restore failed for foreign key constraint  (Neha Sharma <neha.sharma@enterprisedb.com>)
Список pgsql-hackers
Neha Sharma <neha.sharma@enterprisedb.com> writes:
> I am getting the below error while restoring data having foreign key
> constraint.

> [edb@localhost bin]$ ./createdb test1
> [edb@localhost bin]$ ./pg_restore -d test1 -c -e a.dump
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 2903; 2606 16399 FK
> CONSTRAINT test_tbl test_tbl_fk_c1 edb
> pg_restore: [archiver (db)] could not execute query: ERROR:  schema "test"
> does not exist
>     Command was: ALTER TABLE ONLY test.test_tbl DROP CONSTRAINT
> test_tbl_fk_c1;

> Is this an expected behaviour?

Yes, it is.  Either don't use -c (it's entirely useless when restoring
into an empty database), or specify --if-exists, or ignore the errors.
        regards, tom lane



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

Предыдущее
От: Shubham Barai
Дата:
Сообщение: Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)
Следующее
От: Andrew Dunstan
Дата:
Сообщение: [HACKERS] Unportable use of select for timeouts in PostgresNode.pm