Re: Add option --drop-cascade for pg_dump/restore - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add option --drop-cascade for pg_dump/restore
Date
Msg-id 3733007.1626442811@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add option --drop-cascade for pg_dump/restore  (vignesh C <vignesh21@gmail.com>)
Responses Re: Add option --drop-cascade for pg_dump/restore  (Andrew Dunstan <andrew@dunslane.net>)
Re: Add option --drop-cascade for pg_dump/restore  (Greg Sabino Mullane <htamfids@gmail.com>)
List pgsql-hackers
vignesh C <vignesh21@gmail.com> writes:
> On Tue, Jul 13, 2021 at 9:16 PM Wu Haotian <whtsky@gmail.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



pgsql-hackers by date:

Previous
From: James Coleman
Date:
Subject: Re: [PATCH] Use optimized single-datum tuplesort in ExecSort
Next
From: Andrew Dunstan
Date:
Subject: Re: Add option --drop-cascade for pg_dump/restore