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