v1-0001-pg_restore-Fix-wrong-descriptions-of-with-schema-.patch
text/plain
Filename: v1-0001-pg_restore-Fix-wrong-descriptions-of-with-schema-.patch
Type: text/plain
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v1-0001
Subject: pg_restore: Fix wrong descriptions of --with-{schema,data,statistics} options.
| File | + | − |
|---|---|---|
| doc/src/sgml/ref/pg_restore.sgml | 6 | 3 |
| src/bin/pg_dump/pg_restore.c | 3 | 3 |
From 42d796b2dfa09c4f45502c804f7939331d285af8 Mon Sep 17 00:00:00 2001
From: Fujii Masao <fujii@postgresql.org>
Date: Wed, 11 Jun 2025 09:53:14 +0900
Subject: [PATCH v1] pg_restore: Fix wrong descriptions of
--with-{schema,data,statistics} options.
Commit bde2fb797aa added the --with-schema, --with-data, and --with-statistics
options to pg_restore. These options control whether to restore schema, data,
or statistics if present in the archive. However, the help message and
documentation incorrectly described them as affecting what gets dumped.
This commit corrects those descriptions to clarify that the options control
restoration, not dumping.
---
doc/src/sgml/ref/pg_restore.sgml | 9 ++++++---
src/bin/pg_dump/pg_restore.c | 6 +++---
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml
index 2295df62d03..8c88b07dcc8 100644
--- a/doc/src/sgml/ref/pg_restore.sgml
+++ b/doc/src/sgml/ref/pg_restore.sgml
@@ -923,7 +923,8 @@ PostgreSQL documentation
<term><option>--with-data</option></term>
<listitem>
<para>
- Dump data. This is the default.
+ Output commands to restore data, if the archive contains them.
+ This is the default.
</para>
</listitem>
</varlistentry>
@@ -932,7 +933,8 @@ PostgreSQL documentation
<term><option>--with-schema</option></term>
<listitem>
<para>
- Dump schema (data definitions). This is the default.
+ Output commands to restore schema (data definitions), if the archive
+ contains them. This is the default.
</para>
</listitem>
</varlistentry>
@@ -941,7 +943,8 @@ PostgreSQL documentation
<term><option>--with-statistics</option></term>
<listitem>
<para>
- Dump statistics. This is the default.
+ Output commands to restore statistics, if the archive contains them.
+ This is the default.
</para>
</listitem>
</varlistentry>
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index f2182e91825..c4b6214d618 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -712,9 +712,9 @@ usage(const char *progname)
printf(_(" --use-set-session-authorization\n"
" use SET SESSION AUTHORIZATION commands instead of\n"
" ALTER OWNER commands to set ownership\n"));
- printf(_(" --with-data dump the data\n"));
- printf(_(" --with-schema dump the schema\n"));
- printf(_(" --with-statistics dump the statistics\n"));
+ printf(_(" --with-data restore the data\n"));
+ printf(_(" --with-schema restore the schema\n"));
+ printf(_(" --with-statistics restore the statistics\n"));
printf(_("\nConnection options:\n"));
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
--
2.49.0