Re: pg_dump --with-* options
Álvaro Herrera <alvherre@kurilemu.de>
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>, Robert Haas <robertmhaas@gmail.com>,
Nathan Bossart <nathandbossart@gmail.com>, Peter Eisentraut <peter@eisentraut.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-30T20:04:14Z
Lists: pgsql-hackers
On 2025-Jul-30, Jeff Davis wrote:
> 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%40mail.gmail.com
Oh, I hadn't seen it, but now that I do, it seems identical to mine. He
even used some of the same terms I did.
> > 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.
Of course.
> 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.
IMO we should only allow one --include.
> If we go in this direction, it might be easier to just say that --
> include conflicts with --schema-only and --data-only.
Yep.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Small aircraft do not crash frequently ... usually only once!"
(ponder, http://thedailywtf.com/)
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Simplify options in pg_dump and pg_restore.
- 6a46089e458f 19 (unreleased) landed
- a3e8dc143862 18.0 landed
-
pg_dump: reject combination of "only" and "with"
- 0ed92cf50cc4 19 (unreleased) landed
- 60121890f7f2 18.0 landed
-
Change pg_dump default for statistics export.
- 34eb2a80d5a3 18.0 cited