pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: vignesh C <vignesh21@gmail.com>
Cc: Joan <aseques@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: pg_dump needs an option to add the force flag to the drop database
Date: Mon, 17 Jul 2023 23:51:16 -0400
Message-ID: <4134281.1689652276@sss.pgh.pa.us> (raw)
In-Reply-To: <CALDaNm0PLojTF0B_eyDxV_HTZSejU7tKSCgsbtR2cf6rsHsUGA@mail.gmail.com>
References: <CAP4s+CGPvvN4RioLr1kFXXTEQ3GRkO8gx2vuF7Sihus=K7ipEA@mail.gmail.com>
	<CALDaNm0PLojTF0B_eyDxV_HTZSejU7tKSCgsbtR2cf6rsHsUGA@mail.gmail.com>

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 useful when 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





view thread (4+ messages)  latest in thread

Message-ID: <4134281.1689652276@sss.pgh.pa.us>
Permalink:  ../4134281.1689652276@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4134281.1689652276@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, vignesh21@gmail.com, aseques@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: pg_dump needs an option to add the force flag to the drop database
  In-Reply-To: <4134281.1689652276@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox