Re: pg_dump needs an option to add the force flag to the drop database - Mailing list pgsql-bugs

From Tom Lane
Subject Re: pg_dump needs an option to add the force flag to the drop database
Date
Msg-id 4134281.1689652276@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump needs an option to add the force flag to the drop database  (vignesh C <vignesh21@gmail.com>)
Responses Re: pg_dump needs an option to add the force flag to the drop database
List pgsql-bugs
vignesh C <vignesh21@gmail.com> writes:
> On Mon, 17 Jul 2023 at 14:18, Joan <aseques@gmail.com> wrote:
>> Having an option to add the FORCE option to either the generated dump by pg_dump, or in the pg_restore would be very
usefulwhen restoring the databases so it would avoid having to do scripting. 

> It would be better to raise this enhancement request in -hackers, as
> it can be discussed there and taken forward accordingly from there.

Yeah, this is not a bug.

I'm not sure that it's a sane feature request either.  pg_dump scripts are
not designed to deal with concurrent modifications to the target database
during restore, and I doubt that we want to invest effort in making them
proof against such situations.  Even if you only consider read-only
concurrent accesses, what client is going to be pleased with seeing a
half-restored database?  So I don't quite follow what is the use-case
for doing DROP DATABASE FORCE here.  Realistically you need a stronger
defense against concurrent users than that would offer.

            regards, tom lane



pgsql-bugs by date:

Previous
From: vignesh C
Date:
Subject: Re: pg_dump needs an option to add the force flag to the drop database
Next
From: Michael Paquier
Date:
Subject: Re: The same 2PC data maybe recovered twice