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

From Haotian Wu
Subject Re: Add option --drop-cascade for pg_dump/restore
Date
Msg-id 916EF7CB-F7FB-4264-BD0B-DB25226C5BBD@gmail.com
Whole thread Raw
In response to Re: Add option --drop-cascade for pg_dump/restore  (Greg Sabino Mullane <htamfids@gmail.com>)
Responses Re: Add option --drop-cascade for pg_dump/restore  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
Hi,

I agree that —drop-cascade does not make sense for pg_dumpall, so I removed them.

> are we expecting more things to appear after the semi-colon?

No, I was just trying to “reuse” original statement as much as possible. Append “\n” manually should also do the job,
andI’ve updated the patch as you suggests. 



> 2021年5月29日 上午2:39,Greg Sabino Mullane <htamfids@gmail.com> 写道:
>
> Overall the patch looks good, but I did notice a few small things:
>
> 1. In pg_dumpall.c, the section  /* Add long options to the pg_dump argument list */, we are now
> passing along the --drop-cascade option. However, --clean is not passed in, so
> any call to pg_dumpall using --drop-cascade fails a the pg_dump step. You'll note
> that --if-exists it not passed along either; because we are dropping the whole database, we don't
> need to have pg_dump worry about dropping objects at all. So I think that
> --drop-cascade should NOT be passed along from pg_dumpall to pg_dump.
>
> 2. I'm not even sure if --drop-cascade makes sense for pg_dumpall, as you cannot cascade global things like databases
androles. 
>
> 3. In the file pg_backup_archiver.c, the patch does a
> stmtEnd = strstr(mark + strlen(buffer), ";");" and then spits
> out things "past" the semicolon as the final %s in the appendPQExpBuffer line.
> I'm not clear why: are we expecting more things to appear after the semi-colon?
> Why not just append a "\n" manually as part of the previous %s?
>
> Cheers,
> Greg
>
> The new status of this patch is: Waiting on Author


Attachment

pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: Synchronous commit behavior during network outage
Next
From: Amit Kapila
Date:
Subject: Re: Refactor "mutually exclusive options" error reporting code in parse_subscription_options