Re: PG_DUMP/RESTORE Would like an explanation of these (non-critical) errors

Поиск
Список
Период
Сортировка
От ANdreas Wenk
Тема Re: PG_DUMP/RESTORE Would like an explanation of these (non-critical) errors
Дата
Msg-id 4A4E6480.5020201@netzmeister-st-pauli.de
обсуждение исходный текст
Ответ на PG_DUMP/RESTORE Would like an explanation of these (non-critical) errors  ("James B. Byrne" <byrnejb@harte-lyne.ca>)
Список pgsql-general
James B. Byrne wrote:

Hi,
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 4; 2615 2200 SCHEMA
> public postgres
> pg_restore: [archiver (db)] could not execute query: ERROR:  cannot
> drop
> schema public because other objects depend on it
> HINT:  Use DROP ... CASCADE to drop the dependent objects too.
>     Command was: DROP SCHEMA public;
> pg_restore: [archiver (db)] could not execute query: ERROR:  schema
> "public" already exists
>     Command was: CREATE SCHEMA public;
> WARNING: errors ignored on restore: 2
>
>
> The pg_dump command is:
>
> pg_dump --create --format=c --user=postgres --verbose hll_redmine |
> gzip > /var/data/pas-redmine/db/dump/hll_redmine.pgsql.gz && rsync
> -avz --bwlimit=35 --delete-after --exclude="database.yml"
> --exclude="*.log" --exclude="*cache" --exclude="*ruby_sess*"
> /var/data/pas-redmine inet03.mississauga.harte-lyne.ca:/var/data 1>
> /dev/null

--create is not working here because you select a custom format for your
dump. --create is only working with plain SQL dumps.

> The pg_restore command, which generates the error, is:
>
> gunzip < /var/data/pas-redmine/db/dump/hll_redmine.pgsql.gz |
> pg_restore --clean --user=postgres --dbname=hll_redmine ; vacuumdb
> --user=postgres --full --analyze hll_redmine 1> /dev/null

with the --clean parameter you delete existing objects in hll_redmine
but there are dependant objects. A common way to avoid this is to drop
the whole database first, create a new one and then restore the dump
into it. Means use --create instead of --clean.

Dropping the database can cause problems because you have to cut all
client connections before being able to cut it. So maybe this approach
is not working for you.

Another idea is not to use any of these parameters and dump only the data.

pg_restore -a

Cheers Andy



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

Предыдущее
От: Martin Gainty
Дата:
Сообщение: Re: Store derived data or use view?
Следующее
От: Michael Black
Дата:
Сообщение: Re: Store derived data or use view?