Re: Add option --drop-cascade for pg_dump/restore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Wu Haotian <whtsky(at)gmail(dot)com>, Greg Sabino Mullane <htamfids(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add option --drop-cascade for pg_dump/restore
Date: 2021-07-16 13:40:11
Message-ID: 3733007.1626442811@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

vignesh C <vignesh21(at)gmail(dot)com> writes:
> On Tue, Jul 13, 2021 at 9:16 PM Wu Haotian <whtsky(at)gmail(dot)com> wrote:
>> I may not understand it correctly, are you saying
>> pg_dump will include the cascade option only for plain format, or
>> pg_dump will enable the cascade option for plain by default?

> pg_dump support plain, custom, tar and directory format, I think,
> cascade option will be added by pg_dump only for plain format and for
> the other format pg_restore will include the cascade option. Should we
> document this somewhere?

That would require pg_restore to try to edit the DROP commands during
restore, which sounds horribly fragile. I'm inclined to think that
supporting this option only during initial dump is safer.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-07-16 14:00:02 Re: Add option --drop-cascade for pg_dump/restore
Previous Message Stephen Frost 2021-07-16 13:17:44 Re: Improve documentation for pg_upgrade, standbys and rsync