From: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> |
---|---|
To: | Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_restore documentation and --create/--single-transaction limitation |
Date: | 2025-09-30 09:30:50 |
Message-ID: | 2ebde3606beab536a8693e8f54c33dc0981b8478.camel@cybertec.at |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, 2025-03-24 at 17:11 +0530, Ashutosh Bapat wrote:
> The pg_restore documentation usually mentions the pair of switches
> which can not be used together. However, it does not mention that
> --create and --single-transaction can not be used together. Here's a
> patch fixing the same.
>
> Looking for a precedence, I found that we have mentioned a similar
> limitation concerning --data-only and --schema-only only under
> --schema and not at both the sections. Maybe it's missing or we chose
> to mention it only at one place. But then I am not sure which one
> place I should use to mention the new limitation. So, I have added the
> note in the sections corresponding to both the switches so that a user
> reading either of them knows about the limitation.
I grepped the source for all incompatible options:
pg_log_error("options -d/--dbname and -f/--file cannot be used together");
pg_fatal("options -d/--dbname and --restrict-key cannot be used together");
pg_fatal("options -s/--schema-only and -a/--data-only cannot be used together");
pg_fatal("options -s/--schema-only and --statistics-only cannot be used together");
pg_fatal("options -a/--data-only and --statistics-only cannot be used together");
pg_fatal("options -a/--data-only and --no-data cannot be used together");
pg_fatal("options -s/--schema-only and --no-schema cannot be used together");
pg_fatal("options --statistics-only and --no-statistics cannot be used together");
pg_fatal("options --statistics and --no-statistics cannot be used together");
pg_fatal("options %s and %s cannot be used together",
"-a/--data-only", "--statistics");
pg_fatal("options %s and %s cannot be used together",
"-s/--schema-only", "--statistics");
pg_fatal("options -c/--clean and -a/--data-only cannot be used together");
pg_fatal("options -1/--single-transaction and --transaction-size cannot be used together");
pg_fatal("options -C/--create and -1/--single-transaction cannot be used together");
pg_fatal("cannot specify both --single-transaction and multiple jobs");
Most of them are pretty obvious and need no documentation. The ones
that are not obvious unless you know the inner workings are that last
two, and the last one is already documented under --jobs.
So I think that your suggestion makes sense.
I tried to improve the English, and I have added the incompatibility
with multiple --jobs to the --single-transaction documentation.
Does that look alright to you?
Yours,
Laurenz Albe
Attachment | Content-Type | Size |
---|---|---|
v2-0001-Document-incompatible-pg_restore-options.patch | text/x-patch | 1.9 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Burd | 2025-09-30 09:30:51 | Re: [PATCH] Add tests for Bitmapset |
Previous Message | Stefanie Janine Stölting | 2025-09-30 09:17:07 | Re: Problem with DEB packages |