pg_dump needs an option to add the force flag to the drop database

From: Joan <aseques(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: pg_dump needs an option to add the force flag to the drop database
Date: 2023-07-17 08:47:45
Message-ID: CAP4s+CGPvvN4RioLr1kFXXTEQ3GRkO8gx2vuF7Sihus=K7ipEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Since posgres 13 there's the option to do a FORCE when dropping a database
(so it disconnects current users) Documentation here:
https://www.postgresql.org/docs/current/sql-dropdatabase.html
I am currently using dir format for the output
pg_dump -d "bdname" -F d -j 4 -v -f /tmp/dir

Having an option to add the FORCE option to either the generated dump by
pg_dump, or in the pg_restore would be very useful when restoring the
databases so it would avoid having to do scripting.

Regards,

Joan

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message suyu.cmj 2023-07-17 09:20:00 Re: The same 2PC data maybe recovered twice
Previous Message Michael Paquier 2023-07-17 08:29:18 Re: pg_basebackup: errors on macOS on directories with ".DS_Store" files