Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v3WhF-0001iX-Tw for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Sep 2025 09:30:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v3WhD-008152-TX for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Sep 2025 09:30:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v3WhD-00814s-Em for pgsql-hackers@lists.postgresql.org; Tue, 30 Sep 2025 09:30:56 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v3WhA-000faJ-2V for pgsql-hackers@postgresql.org; Tue, 30 Sep 2025 09:30:55 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-62fc28843ecso7833435a12.1 for ; Tue, 30 Sep 2025 02:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1759224652; x=1759829452; darn=postgresql.org; h=mime-version:user-agent:references:in-reply-to:date:to:from:subject :message-id:from:to:cc:subject:date:message-id:reply-to; bh=kfTcoGz2qSD+eXN5MyeQBshxevLOU1OY5xy8wcna9oE=; b=dADEq7yysrbt4G7bzs4VsEWPKzf7ptoLLLdJz/KUX0YcsHK2NQoFyZcf1Jtcy30IG3 EvZ7MKekN/3ZcOtTShZ4Wrtht6fQBy0C51rO4p8zWBuq2bHAgNRmisv1qz39IsQxmoG6 pLcmKQ/BvLRpQJtXOUkXdR8NYOaAGoTiGHRRWzO283rbkXz6BvvnP06GdnWlPLJlbs+r t00h8eifpGpiBOZPGWs6Whlqhl22jWHBXZV9le+qK61cASxU+iDmBBsrleh3xEzgiIRB 7FjBZyKGNTNA8giVolGMgYmrepND6S8fCCtwtgECVD7NcAkfkTR+7IG2k+hTRuwVJNtS 5GFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759224652; x=1759829452; h=mime-version:user-agent:references:in-reply-to:date:to:from:subject :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kfTcoGz2qSD+eXN5MyeQBshxevLOU1OY5xy8wcna9oE=; b=C1TvvBLjLfZk6lasMfXfrhDas5Uwo332rdr8Nu8v+rWmtqIGPpymFlMD/CqhYEl3pq dcu+QTjO9OscuVRada3A2gBv0FdLGT2N7uuaSkreeiCYxet1xAssOCT3SLNpdAaqroOs 3y5u9Zowg1fw1NGz81ktMkBQPQ3L5TABcz8x6IdEkf5GAMLjN1CqBW0aGoGH1vXtE52L KoQDo+v9Y7cuxABeVuoxgb6Lrk50ci+5jyFfdGhR4KOm+STcttP7pereVGBCmFD1Xl9m yDVzjxg72vICywvQCF2OpYYWBxbx5aJuHgiPRCren2RE+SSSylPN24GMcxObjcnVlp7J ac/w== X-Forwarded-Encrypted: i=1; AJvYcCXOJNY2vEMNKBZGnsnD2CfDY7ywEoB9efuASEpqun8BWRu+rx1msxDFVa+KfIY0w6HXBPZb1wFuZeAkRDxn@postgresql.org X-Gm-Message-State: AOJu0YyCjintvpbEjNyX2uDMmnJF6wtS9tEh03SpujCxjD4ENfo+jzbl Dv3MU5bxhrF+txRJl477Qg+QDu4mT2FTV53yrNNePPRaL7KicN1NWFnducI/vITTNY8= X-Gm-Gg: ASbGnctY5TV78NFkqPcNvnpoHJh6cGl3oy2TUYoQQyJBg0GEX5BZtsFP6xYzH4tZW7B lu0XQAY+Cjn5fdJ27OjuJ24cDr8ztFwIU/dy/58r2qRk5JNmRxrhiELAYMyX5WMyn07DgIi7Kwj ztYgVheboXTqS4tBX9LSfb/uXMuzk9a+HuEmeuHnF/C2ws5IgM3e6C+/itZPGvVdbpn8vFpQMGy 5GLL7QRw0sUaKCYeF/Rh169ENDb7aftUVW8Nc6kw+OYj/18ljc3N7N2z2bid9fcQ9J+3UyjSgBX JFGVkZNjiJ1IMlYG+nO+N7ykcmLlLswc5GJQTI1pSbySQCzZd3lO0r2gNm2il6rwGu6ZCV9eCEA 4t0EM/cvX0Gi4Ppb2w8+pdfOFRxayIOWM/f9DygD2PqRskwWeZ9vlNQYLnllIGpFUPPCx16LwaH eYRPwqSfoXKvE= X-Google-Smtp-Source: AGHT+IE2lFhHosq2BwLwTjHtEOvmfEfNtcVnQKxlsQfRsk90Ymh212IHyqdV+ByVSd9lPqgmZPbHsQ== X-Received: by 2002:a05:6402:278c:b0:636:24da:490b with SMTP id 4fb4d7f45d1cf-63624da4ce7mr10198605a12.33.1759224651967; Tue, 30 Sep 2025 02:30:51 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([88.116.133.170]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-634a3339b63sm9286956a12.0.2025.09.30.02.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Sep 2025 02:30:51 -0700 (PDT) Message-ID: <2ebde3606beab536a8693e8f54c33dc0981b8478.camel@cybertec.at> Subject: Re: pg_restore documentation and --create/--single-transaction limitation From: Laurenz Albe To: Ashutosh Bapat , pgsql-hackers Date: Tue, 30 Sep 2025 11:30:50 +0200 In-Reply-To: References: Content-Type: multipart/mixed; boundary="=-+S+GNK3UvxTYR1ZLGg3G" User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-+S+GNK3UvxTYR1ZLGg3G Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2025-03-24 at 17:11 +0530, Ashutosh Bapat wrote: > 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. >=20 > 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. I grepped the source for all incompatible options: pg_log_error("options -d/--dbname and -f/--file cannot be used together")= ; pg_fatal("options -d/--dbname and --restrict-key cannot be used together"= ); pg_fatal("options -s/--schema-only and -a/--data-only cannot be used toge= ther"); pg_fatal("options -s/--schema-only and --statistics-only cannot be used t= ogether"); pg_fatal("options -a/--data-only and --statistics-only cannot be used tog= ether"); pg_fatal("options -a/--data-only and --no-data cannot be used together"); pg_fatal("options -s/--schema-only and --no-schema cannot be used togethe= r"); pg_fatal("options --statistics-only and --no-statistics cannot be used to= gether"); pg_fatal("options --statistics and --no-statistics cannot be used togethe= r"); pg_fatal("options %s and %s cannot be used together", "-a/--data-only", "--statistics"); pg_fatal("options %s and %s cannot be used together", "-s/--schema-only", "--statistics"); pg_fatal("options -c/--clean and -a/--data-only cannot be used together")= ; pg_fatal("options -1/--single-transaction and --transaction-size cannot b= e used together"); pg_fatal("options -C/--create and -1/--single-transaction cannot be used = together"); pg_fatal("cannot specify both --single-transaction and multiple jobs"); Most of them are pretty obvious and need no documentation. The ones that are not obvious unless you know the inner workings are that last two, and the last one is already documented under --jobs. So I think that your suggestion makes sense. I tried to improve the English, and I have added the incompatibility with multiple --jobs to the --single-transaction documentation. Does that look alright to you? Yours, Laurenz Albe --=-+S+GNK3UvxTYR1ZLGg3G Content-Disposition: attachment; filename="v2-0001-Document-incompatible-pg_restore-options.patch" Content-Transfer-Encoding: base64 Content-Type: text/x-patch; name="v2-0001-Document-incompatible-pg_restore-options.patch"; charset="UTF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