Hi All,
The pg_restore documentation usually mentions the pair of switches
which can not be used together. However, it does not mention that
--create and --single-transaction can not be used together. Here's a
patch fixing the same.

Looking for a precedence, I found that we have mentioned a similar
limitation concerning --data-only and --schema-only only under
--schema and not at both the sections. Maybe it's missing or we chose
to mention it only at one place. But then I am not sure which one
place I should use to mention the new limitation. So, I have added the
note in the sections corresponding to both the switches so that a user
reading either of them knows about the limitation.

-- 
Best Wishes,
Ashutosh Bapat
From e9efa27688cb0f85825fd7cda02118818a1edeae Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <ashutosh.bapat....@gmail.com>
Date: Mon, 24 Mar 2025 16:59:16 +0530
Subject: [PATCH] pg_restore documentation correction

--create and --single-transaction switches cannot be specified together. But
--pg_restore documentation does not mention this. Fix the documentation.

Author: Ashutosh Bapat
---
 doc/src/sgml/ref/pg_restore.sgml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml
index 35140187807..1ae28cb8efb 100644
--- a/doc/src/sgml/ref/pg_restore.sgml
+++ b/doc/src/sgml/ref/pg_restore.sgml
@@ -148,6 +148,10 @@ PostgreSQL documentation
         <command>CREATE DATABASE</command> commands.  All data is restored into the
         database name that appears in the archive.
        </para>
+
+       <para>
+        This option cannot be used with <option>--single-transaction</option>.
+       </para>
       </listitem>
      </varlistentry>
 
@@ -618,7 +622,8 @@ PostgreSQL documentation
         emitted commands in <command>BEGIN</command>/<command>COMMIT</command>).  This
         ensures that either all the commands complete successfully, or no
         changes are applied. This option implies
-        <option>--exit-on-error</option>.
+        <option>--exit-on-error</option>. This option cannot be used with
+        <option>--create</option>.
        </para>
       </listitem>
      </varlistentry>

base-commit: 19c6eb06c51f4da70e2ea0f1bdb64a0142e8e2aa
-- 
2.34.1

Reply via email to