pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18952: pg_restore --help and document have strange description: Dump something
6+ messages / 4 participants
[nested] [flat]

* BUG #18952: pg_restore --help and document have strange description: Dump something
@ 2025-06-10 07:35 PG Bug reporting form <noreply@postgresql.org>
  2025-06-11 01:04 ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Fujii Masao <masao.fujii@oss.nttdata.com>
  0 siblings, 1 reply; 6+ messages in thread

From: PG Bug reporting form @ 2025-06-10 07:35 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: harukat@sraoss.co.jp

The following bug has been logged on the website:

Bug reference:      18952
Logged by:          TAKATSUKA Haruka
Email address:      harukat@sraoss.co.jp
PostgreSQL version: 18beta1
Operating system:   any
Description:        

pg_restore --help has strange description like "Dump .....":
[dbhost]$ LANG=C pg_restore --help
pg_restore restores PostgreSQL databases from archives created by pg_dump or
pg_dumpall.
Usage:
  pg_restore [OPTION]... [FILE]
(snip)
  --with-data                  dump the data
  --with-schema                dump the schema
  --with-statistics            dump the statistics
Connection options:
  -h, --host=HOSTNAME      database server host or socket directory
(snip)
https://www.postgresql.org/docs/18/app-pgrestore.html also have the
following description.
--with-data
    Dump data. This is the default.
--with-schema
    Dump schema (data definitions). This is the default.
--with-statistics
    Dump statistics. This is the default.



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #18952: pg_restore --help and document have strange description: Dump something
  2025-06-10 07:35 BUG #18952: pg_restore --help and document have strange description: Dump something PG Bug reporting form <noreply@postgresql.org>
@ 2025-06-11 01:04 ` Fujii Masao <masao.fujii@oss.nttdata.com>
  2025-06-11 02:38   ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something TAKATSUKA Haruka <harukat@sraoss.co.jp>
  0 siblings, 1 reply; 6+ messages in thread

From: Fujii Masao @ 2025-06-11 01:04 UTC (permalink / raw)
  To: harukat@sraoss.co.jp; pgsql-bugs@lists.postgresql.org



On 2025/06/10 16:35, PG Bug reporting form wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      18952
> Logged by:          TAKATSUKA Haruka
> Email address:      harukat@sraoss.co.jp
> PostgreSQL version: 18beta1
> Operating system:   any
> Description:
> 
> pg_restore --help has strange description like "Dump .....":
> [dbhost]$ LANG=C pg_restore --help
> pg_restore restores PostgreSQL databases from archives created by pg_dump or
> pg_dumpall.
> Usage:
>    pg_restore [OPTION]... [FILE]
> (snip)
>    --with-data                  dump the data
>    --with-schema                dump the schema
>    --with-statistics            dump the statistics
> Connection options:
>    -h, --host=HOSTNAME      database server host or socket directory
> (snip)
> https://www.postgresql.org/docs/18/app-pgrestore.html also have the
> following description.
> --with-data
>      Dump data. This is the default.
> --with-schema
>      Dump schema (data definitions). This is the default.
> --with-statistics
>      Dump statistics. This is the default.

Thanks for the report!

Are you suggesting that "dump" in the help message and docs should be "restore"?
If so, does the attached patch address that correctly?

Regards,

-- 
Fujii Masao
NTT DATA Japan Corporation
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



Attachments:

  [text/plain] v1-0001-pg_restore-Fix-wrong-descriptions-of-with-schema-.patch (3.0K, ../../df4a3f45-3559-4fa0-9ae9-d1fbb1b4bb42@oss.nttdata.com/2-v1-0001-pg_restore-Fix-wrong-descriptions-of-with-schema-.patch)
  download | inline diff:
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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #18952: pg_restore --help and document have strange description: Dump something
  2025-06-10 07:35 BUG #18952: pg_restore --help and document have strange description: Dump something PG Bug reporting form <noreply@postgresql.org>
  2025-06-11 01:04 ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Fujii Masao <masao.fujii@oss.nttdata.com>
@ 2025-06-11 02:38   ` TAKATSUKA Haruka <harukat@sraoss.co.jp>
  2025-06-12 12:20     ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Fujii Masao <masao.fujii@oss.nttdata.com>
  0 siblings, 1 reply; 6+ messages in thread

From: TAKATSUKA Haruka @ 2025-06-11 02:38 UTC (permalink / raw)
  To: Fujii Masao <masao.fujii@oss.nttdata.com>; +Cc: pgsql-bugs@lists.postgresql.org

On Wed, 11 Jun 2025 10:04:24 +0900
Fujii Masao <masao.fujii@oss.nttdata.com> wrote:

> On 2025/06/10 16:35, PG Bug reporting form wrote:
> > The following bug has been logged on the website:
> > 
> > Bug reference:      18952
> > Logged by:          TAKATSUKA Haruka
> > Email address:      harukat@sraoss.co.jp
> > PostgreSQL version: 18beta1
> > Operating system:   any
> > Description:
> > 
> > pg_restore --help has strange description like "Dump .....":
> > [dbhost]$ LANG=C pg_restore --help
> > pg_restore restores PostgreSQL databases from archives created by pg_dump or
> > pg_dumpall.
> > Usage:
> >    pg_restore [OPTION]... [FILE]
> > (snip)
> >    --with-data                  dump the data
> >    --with-schema                dump the schema
> >    --with-statistics            dump the statistics
> > Connection options:
> >    -h, --host=HOSTNAME      database server host or socket directory
> > (snip)
> > https://www.postgresql.org/docs/18/app-pgrestore.html also have the
> > following description.
> > --with-data
> >      Dump data. This is the default.
> > --with-schema
> >      Dump schema (data definitions). This is the default.
> > --with-statistics
> >      Dump statistics. This is the default.
> 
> Thanks for the report!
> 
> Are you suggesting that "dump" in the help message and docs should be "restore"?
> If so, does the attached patch address that correctly?

Yes.
IMHO, if we take the intent of the commit bde2fb797aae, your patch is correct.





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #18952: pg_restore --help and document have strange description: Dump something
  2025-06-10 07:35 BUG #18952: pg_restore --help and document have strange description: Dump something PG Bug reporting form <noreply@postgresql.org>
  2025-06-11 01:04 ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Fujii Masao <masao.fujii@oss.nttdata.com>
  2025-06-11 02:38   ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something TAKATSUKA Haruka <harukat@sraoss.co.jp>
@ 2025-06-12 12:20     ` Fujii Masao <masao.fujii@oss.nttdata.com>
  2025-06-12 12:28       ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 6+ messages in thread

From: Fujii Masao @ 2025-06-12 12:20 UTC (permalink / raw)
  To: TAKATSUKA Haruka <harukat@sraoss.co.jp>; +Cc: pgsql-bugs@lists.postgresql.org



On 2025/06/11 11:38, TAKATSUKA Haruka wrote:
> On Wed, 11 Jun 2025 10:04:24 +0900
> Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
> 
>> On 2025/06/10 16:35, PG Bug reporting form wrote:
>>> The following bug has been logged on the website:
>>>
>>> Bug reference:      18952
>>> Logged by:          TAKATSUKA Haruka
>>> Email address:      harukat@sraoss.co.jp
>>> PostgreSQL version: 18beta1
>>> Operating system:   any
>>> Description:
>>>
>>> pg_restore --help has strange description like "Dump .....":
>>> [dbhost]$ LANG=C pg_restore --help
>>> pg_restore restores PostgreSQL databases from archives created by pg_dump or
>>> pg_dumpall.
>>> Usage:
>>>     pg_restore [OPTION]... [FILE]
>>> (snip)
>>>     --with-data                  dump the data
>>>     --with-schema                dump the schema
>>>     --with-statistics            dump the statistics
>>> Connection options:
>>>     -h, --host=HOSTNAME      database server host or socket directory
>>> (snip)
>>> https://www.postgresql.org/docs/18/app-pgrestore.html also have the
>>> following description.
>>> --with-data
>>>       Dump data. This is the default.
>>> --with-schema
>>>       Dump schema (data definitions). This is the default.
>>> --with-statistics
>>>       Dump statistics. This is the default.
>>
>> Thanks for the report!
>>
>> Are you suggesting that "dump" in the help message and docs should be "restore"?
>> If so, does the attached patch address that correctly?
> 
> Yes.
> IMHO, if we take the intent of the commit bde2fb797aae, your patch is correct.

Okay, so if there are no objections, I'll go ahead and commit the patch.

Regards,

-- 
Fujii Masao
NTT DATA Japan Corporation






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #18952: pg_restore --help and document have strange description: Dump something
  2025-06-10 07:35 BUG #18952: pg_restore --help and document have strange description: Dump something PG Bug reporting form <noreply@postgresql.org>
  2025-06-11 01:04 ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Fujii Masao <masao.fujii@oss.nttdata.com>
  2025-06-11 02:38   ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something TAKATSUKA Haruka <harukat@sraoss.co.jp>
  2025-06-12 12:20     ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Fujii Masao <masao.fujii@oss.nttdata.com>
@ 2025-06-12 12:28       ` Daniel Gustafsson <daniel@yesql.se>
  2025-06-12 14:27         ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Fujii Masao <masao.fujii@oss.nttdata.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Daniel Gustafsson @ 2025-06-12 12:28 UTC (permalink / raw)
  To: Fujii Masao <masao.fujii@oss.nttdata.com>; +Cc: TAKATSUKA Haruka <harukat@sraoss.co.jp>; pgsql-bugs@lists.postgresql.org

> On 12 Jun 2025, at 14:20, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:

> Okay, so if there are no objections, I'll go ahead and commit the patch.

Nice catch, your patch looks correct.

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #18952: pg_restore --help and document have strange description: Dump something
  2025-06-10 07:35 BUG #18952: pg_restore --help and document have strange description: Dump something PG Bug reporting form <noreply@postgresql.org>
  2025-06-11 01:04 ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Fujii Masao <masao.fujii@oss.nttdata.com>
  2025-06-11 02:38   ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something TAKATSUKA Haruka <harukat@sraoss.co.jp>
  2025-06-12 12:20     ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Fujii Masao <masao.fujii@oss.nttdata.com>
  2025-06-12 12:28       ` Re: BUG #18952: pg_restore --help and document have strange description: Dump something Daniel Gustafsson <daniel@yesql.se>
@ 2025-06-12 14:27         ` Fujii Masao <masao.fujii@oss.nttdata.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2025-06-12 14:27 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: TAKATSUKA Haruka <harukat@sraoss.co.jp>; pgsql-bugs@lists.postgresql.org



On 2025/06/12 21:28, Daniel Gustafsson wrote:
>> On 12 Jun 2025, at 14:20, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
> 
>> Okay, so if there are no objections, I'll go ahead and commit the patch.
> 
> Nice catch, your patch looks correct.

Thanks for the review! Pushed.

Regards,

-- 
Fujii Masao
NTT DATA Japan Corporation






^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2025-06-12 14:27 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-06-10 07:35 BUG #18952: pg_restore --help and document have strange description: Dump something PG Bug reporting form <noreply@postgresql.org>
2025-06-11 01:04 ` Fujii Masao <masao.fujii@oss.nttdata.com>
2025-06-11 02:38   ` TAKATSUKA Haruka <harukat@sraoss.co.jp>
2025-06-12 12:20     ` Fujii Masao <masao.fujii@oss.nttdata.com>
2025-06-12 12:28       ` Daniel Gustafsson <daniel@yesql.se>
2025-06-12 14:27         ` Fujii Masao <masao.fujii@oss.nttdata.com>

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