pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Á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: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pg_dump --with-* options
Date: Wed, 30 Jul 2025 08:04:17 -0700
Message-ID: <cf21ea99caa39e89d26b8d83d78610db8938bdba.camel@j-davis.com> (raw)
In-Reply-To: <202507300823.e4fwfr5vorka@alvherre.pgsql>
References: <202507300823.e4fwfr5vorka@alvherre.pgsql>

On Wed, 2025-07-30 at 10:23 +0200, Álvaro Herrera wrote:
> 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.  

Robert Treat brought up a similar idea before:

https://www.postgresql.org/message-id/CABV9wwO5v8Nu8q%2BxWexMdL3Z%2B2xS%3DfFJMQetBSHy3tR64wNHOA%40ma...

I'm certainly open to (re-)considering it.

> 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.

I assume that should be read as something like "include only", because
--include=data would also be excluding the schema and the stats. And if
that's the case, it does seem strange to do something like "--
include=data --schema-only".

Another question: could you have multiple --include options, like "--
include=data --include=schema"? Because you currently can't do "--data-
only --schema-only". So that would make it not quite an alias.

If we go in this direction, it might be easier to just say that --
include conflicts with --schema-only and --data-only.

Regards,
	Jeff Davis






view thread (72+ messages)  latest in thread

Message-ID: <cf21ea99caa39e89d26b8d83d78610db8938bdba.camel@j-davis.com>
Permalink:  ../cf21ea99caa39e89d26b8d83d78610db8938bdba.camel@j-davis.com/
Also on:    postgresql.org/message-id/cf21ea99caa39e89d26b8d83d78610db8938bdba.camel@j-davis.com

 · 

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: pgsql@j-davis.com, alvherre@kurilemu.de, masao.fujii@oss.nttdata.com, robertmhaas@gmail.com, nathandbossart@gmail.com, peter@eisentraut.org
  Subject: Re: pg_dump --with-* options
  In-Reply-To: <cf21ea99caa39e89d26b8d83d78610db8938bdba.camel@j-davis.com>

* 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