Re: pg_dump --with-* options

Álvaro Herrera <alvherre@kurilemu.de>

From: Álvaro Herrera <alvherre@kurilemu.de>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-29T18:22:24Z
Lists: pgsql-hackers
On 2025-Jul-29, Jeff Davis wrote:

> +	/* reject conflicting "only-" and "with-" options */
> +	if (data_only && with_schema)
> +		pg_fatal("options -a/--data-only and --with-schema cannot be used together");
> +	if (data_only && with_statistics)
> +		pg_fatal("options -a/--data-only and --with-statistics cannot be used together");
> +	if (schema_only && with_data)
> +		pg_fatal("options -s/--schema-only and --with-data cannot be used together");
> +	if (schema_only && with_statistics)
> +		pg_fatal("options -s/--schema-only and --with-statistics cannot be used together");
> +	if (statistics_only && with_data)
> +		pg_fatal("options --statistics-only and --with-data cannot be used together");
> +	if (statistics_only && with_schema)
> +		pg_fatal("options --statistics-only and --with-schema cannot be used together");

Please move the switches themselves out of the translatable message,
otherwise there are too many of them.  For instance,

	pg_fatal("options %s and %s cannot be used together",
	         "-s/--schema-only", "--with-statistics");

Thanks

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Simplify options in pg_dump and pg_restore.

  2. pg_dump: reject combination of "only" and "with"

  3. Change pg_dump default for statistics export.