pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pg_dump --with-* options
Date: Wed, 30 Jul 2025 10:23:08 +0200
Message-ID: <202507300823.e4fwfr5vorka@alvherre.pgsql> (raw)
In-Reply-To: <3cc4f166-0b58-47e2-a03c-7c2873d62b14@oss.nttdata.com>

On 2025-Jun-25, Fujii Masao wrote:

> For the record, my vote is: default "off" for pg_dump and pg_dumpall,
> and "on" for pg_restore.

I don't know if this horse is already dead, so bear with me while I beat
it a little more.

> [...] we could simplify further:
> 
>     * Keep: --schema-only, --data-only, --statistics-only, and --statistics
>     * Remove: --no-schema, --no-data, --no-statistics, --with-schema, and --with-data
>     * Combinations:
>         Schema + Data + Stats     : --statistics
>         Schema + Data             : (default)
>         Schema + Stats            : --schema-only --statistics
>         Data + Stats              : --data-only --statistics
>         Schema only               : --schema-only
>         Data only                 : --data-only
>         Stats only                : --statistics-only

I think combinatorial explosions of options is not a great situation to
be in, particularly if we have to make endless decisions on which
combinations are valid or sensible.  Maybe we should invent a new
switch, something like
  --include=[schema,data,statistics]
with which users can give one or more comma-separated types to be
included in the dump.  

Then we state that --data-only is synonym for --include=data and
--schema-only is synonym for --include=schema, and we don't need any
other switches.  Then it is obvious what happens, how to combine
object types in the dumps and restores, and there's no need to reject
invalid combinations because there aren't any.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Investigación es lo que hago cuando no sé lo que estoy haciendo"
(Wernher von Braun)





view thread (72+ messages)  latest in thread

Message-ID: <202507300823.e4fwfr5vorka@alvherre.pgsql>
Permalink:  ../202507300823.e4fwfr5vorka@alvherre.pgsql/
Also on:    postgresql.org/message-id/202507300823.e4fwfr5vorka@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@kurilemu.de, masao.fujii@oss.nttdata.com, robertmhaas@gmail.com, nathandbossart@gmail.com, pgsql@j-davis.com, peter@eisentraut.org
  Subject: Re: pg_dump --with-* options
  In-Reply-To: <202507300823.e4fwfr5vorka@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox