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

From Andrew Dunstan
Subject Re: Add option --drop-cascade for pg_dump/restore
Date
Msg-id 29913906-a33e-5d5e-2876-2fcdffbc448d@dunslane.net
Whole thread Raw
In response to Re: Add option --drop-cascade for pg_dump/restore  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 7/16/21 9:40 AM, Tom Lane wrote:
> 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.
>
>             



Maybe, but that would push back the time when you would need to decide
you needed this quite a lot. We could also have pg_dump stash a copy of
the CASCADE variant in the TOC that could be used by pg_restore if
required. I'm not sure if it's worth the trouble and extra space though.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Add option --drop-cascade for pg_dump/restore
Next
From: vignesh C
Date:
Subject: Added documentation for cascade and restrict option of drop statistics