Re: pg_restore issue

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_restore issue
Дата
Msg-id 31737.1392229852@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_restore issue  (Leonardo M. Ramé <l.rame@griensu.com>)
Ответы Re: pg_restore issue  (Leonardo M. Ramé <l.rame@griensu.com>)
Список pgsql-general
Leonardo =?iso-8859-1?Q?M=2E_Ram=E9?= <l.rame@griensu.com> writes:
> Hi, I'm trying to restore a database dump using pg_restore with the
> following parameters:

> pg_restore -h 127.0.0.1 -U _postgresql \
>   -c -d postgres --exit-on-error \
>   my_dump.backup

> Note I used "\" to wrap the command, but the real one does not have
> those.

> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 3156; 2606 432226 FK
> CONSTRAINT fkidturno postgres
> pg_restore: [archiver (db)] could not execute query: ERROR:  relation
> "public.turnodocumento" does not exist
>     Command was: ALTER TABLE ONLY public.turnodocumento DROP CONSTRAINT
> fkidturno;

> Why is this happening?, should I change the command I'm using to create
> the backup?.

The -c switch causes pg_restore to try to DROP every object it's about to
restore.  If you're restoring into an empty database then this is useless,
and in fact will not work if you're also using --exit-on-error.  Remove
one or the other switch.

Now, if you expected that all the objects do exist in the target database,
then it might be worth inquiring a bit more closely into what's happening.

            regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Hard upgrade (everything)
Следующее
От: Leonardo M. Ramé
Дата:
Сообщение: Re: pg_restore issue