Re: Proposal to include --exclude-extension Flag in pg_dump

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Ayush Vatsa <ayushvatsa1810(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal to include --exclude-extension Flag in pg_dump
Date: 2024-03-06 10:33:57
Message-ID: CAEZATCWC9eOeQh8caVNorb+4vmRzD9jDcCAhhpU6d6jyetHV_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 1 Jan 2024 at 13:28, Ayush Vatsa <ayushvatsa1810(at)gmail(dot)com> wrote:
>
> According to the documentation of pg_dump when the --extension option is not specified, all non-system extensions in the target database will get dumped.
> > Why do we need to explicitly exclude extensions?
> Hence to include only a few we use --extension, but to exclude a few I am proposing --exclude-extension.
>

Thanks for working on this. It seems like a useful feature to have.
The code changes look good, and it appears to work as expected.

In my opinion the order of options in pg_dump.sgml and the --help
output is fine. Keeping this new option together with -e/--extension
makes it easier to see, while otherwise it would get lost much further
down. Other opinions on that might differ though.

There are a couple of things missing from the patch, that should be added:

1). The --filter option should be extended to support "exclude
extension pattern" lines in the filter file. That syntax is already
accepted, but it throws a not-supported error, but it's hopefully not
too hard to make that work now.

2). It ought to have some tests in the test script.

Regards,
Dean

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Kukushkin 2024-03-06 10:34:29 Re: Infinite loop in XLogPageRead() on standby
Previous Message Stephen Frost 2024-03-06 10:33:02 Re: Statistics Import and Export