Re: patch: option --if-exists for pg_dump
От | Pavel Stehule |
---|---|
Тема | Re: patch: option --if-exists for pg_dump |
Дата | |
Msg-id | CAFj8pRA5x+pT44+R-Pv4=4dPfiUTTBXOkgbe5H8FyeBotKjNLA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: patch: option --if-exists for pg_dump (Alvaro Herrera <alvherre@2ndquadrant.com>) |
Ответы |
Re: patch: option --if-exists for pg_dump
|
Список | pgsql-hackers |
Hi
I am looking to pg_dumpall code, and I am inclined to don't pass --if-exists to pg_dump too.
However, I don't think this is behaving sanely in pg_dumpall. AFAICT,
pg_dumpall does not pass --clean to pg_dump (in other words it only
emits DROP for the global objects, not the objects contained inside
databases), so passing --if-exists results in failures. Therefore I
think the solution is to not pass --if-exists to pg_dump at all, i.e.
keep it internal to pg_dumpall. But maybe I'm missing something.
-c, --clean for pg_dumpall means "drop databases"
<<<<<
Usage:
pg_dumpall [OPTION]...
General options:
-f, --file=FILENAME output file name
-V, --version output version information, then exit
--lock-wait-timeout=TIMEOUT fail after waiting TIMEOUT for a table lock
-?, --help show this help, then exit
Options controlling the output content:
-a, --data-only dump only the data, not the schema
-c, --clean clean (drop) databases before recreating
>>>>>
pg_dumpall [OPTION]...
General options:
-f, --file=FILENAME output file name
-V, --version output version information, then exit
--lock-wait-timeout=TIMEOUT fail after waiting TIMEOUT for a table lock
-?, --help show this help, then exit
Options controlling the output content:
-a, --data-only dump only the data, not the schema
-c, --clean clean (drop) databases before recreating
>>>>>
so --if-exists should to mean
DROP DATABASE IF EXISTS dbname
DROP DATABASE IF EXISTS dbname
do you agree?
Pavel
В списке pgsql-hackers по дате отправления: