Re: ToDo: pg_backup - using a conditional DROP

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: ToDo: pg_backup - using a conditional DROP
Дата
Msg-id CAFj8pRC_4tgCVgyHLnGjOZ3j1WkhQ4XvCqx_OhTKc=oQWgrLqg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ToDo: pg_backup - using a conditional DROP  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello

There is a use case from GoodData's engineer

---
We have many user projects, each project has his own database with
granted permissions.
We use pg_dump with option "--clean" which extends SQL dump with syntax like:
"DROP INDEX tab1_idx1;"
"DROP TABLE tab1;"

When we load such dump into database we get a lot of error messages saying:
"INDEX tab1_idx1 doesn't exists;"
"TABLE tab1 doesn't exists;"

We need "--clean" parameter, because we often need to load dump into
database which is not empty.
On the other hand, we want to get rid of ERROR messages in case some
of tables are missing.

Typically we are need to solve one of following situations:

1, dump user project, restore the data in new project.
Each project, even empty one contains at least table "const".
During load of SQL dump, const table from dump needs to overwrite the
one in database.

2, restore the data in project after fail of previous restoration
E.g. connection lost during restoration, no disc space left on device, ...

3, restore the data in project from backup
For some reason, data in the project are messed up and they need to be
overwritten from backup


Vlada
Vladimír Vacula  (GoodData)

---

Regards

Pavel Stehule


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

Предыдущее
От: Jan Kundrát
Дата:
Сообщение: Re: [Review] Include detailed information about a row failing a CHECK constraint into the error message
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [Review] Include detailed information about a row failing a CHECK constraint into the error message