Обсуждение: Drop Database

Поиск
Список
Период
Сортировка

Drop Database

От
Gustavo FERREYRA
Дата:
Hello, a request, which may be resolved in another way and I did not see it.
When doing a BACKUP plain and using "Include DROP DATABASE statement",
could you add by default "IF EXISTS" ?
Because when doing a restore, if the database does not exist, it gives an error and you have to edit the file to comment out the line.
Thanks for your work and congratulations, it is a very useful and beautiful tool.
Greetings cordially.

Re: Drop Database

От
Adrian Klaver
Дата:
On 3/18/21 3:39 PM, Gustavo FERREYRA wrote:
> Hello, a request, which may be resolved in another way and I did not see it.
> When doing a BACKUP plain and using "Include DROP DATABASE statement",
> could you add by default "IF EXISTS" ?

https://www.postgresql.org/docs/12/app-pgdump.html

--if-exists

     Use conditional commands (i.e., add an IF EXISTS clause) when 
cleaning database objects. This option is not valid unless --clean is 
also specified.



> Because when doing a restore, if the database does not exist, it gives 
> an error and you have to edit the file to comment out the line.

Which should not be causing an issue.


> Thanks for your work and congratulations, it is a very useful and 
> beautiful tool.
> Greetings cordially.
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com