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 1ss5AK-005xQz-Fa for pgsql-hackers@arkaria.postgresql.org; Sat, 21 Sep 2024 18:49:09 +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 1ss5AH-008Hqw-GX for pgsql-hackers@arkaria.postgresql.org; Sat, 21 Sep 2024 18:49:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ss5AH-008Hqo-4J for pgsql-hackers@lists.postgresql.org; Sat, 21 Sep 2024 18:49:06 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ss5AA-000ODN-CR for pgsql-hackers@lists.postgresql.org; Sat, 21 Sep 2024 18:49:05 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a8d29b7edc2so430210066b.1 for ; Sat, 21 Sep 2024 11:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726944538; x=1727549338; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=g2HPc5uWMUG4b7WGKi1RxQWlomoXYPrKWJLv0Smp0a8=; b=jsMaykxalxGozjgaZVz9TJpsRin/Vlq02v5dn7mAK8GVcR3VjhMIp91gDutVS6C0Vf VF62e0a9rIarqi5xOXxg/KezrNuEifBjuiJQdGA/7Hj62NCiWbHviwGWCkz46WIRozYL o5OOJvDE/XS1HYNWHU1j89FQUgejgRn4KXbnhRtjwpL0WGIiQ6XyFUJ/SjNY0MORQFgx dMIwi4Q/WOTmvLiijvcCUfi99lmwykzLR34+ii1JqRiC72HACorA0zapDBTLOk0Uk52A Jn6xrvZL0gFyVrtS/Fgzl56e2TBeiU+u9nzDIEGE0oDKjsbX+EgD3fu93+KC9NiVBS9k bEaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726944538; x=1727549338; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g2HPc5uWMUG4b7WGKi1RxQWlomoXYPrKWJLv0Smp0a8=; b=DNLrbSta42mgFjougd1sLdJ3fDLfW3Md4sfRuG+Vx/ml6Od2Eujosj0DwcFGGcYEFW n2KFq7VEi2tNUmGWNuPJhAfs6yYfPMvhflfRw2BroAgDyWqWmlYCKR/5tdOp8GgpspOf GJ8JDMTIM5DK44PdKAFVbrrq/9UQw0e1BSjQ6xfp9opkqipcrxVtNfy7ZGtqA9spkgZ6 f9gmf1pWcpPqqHGwePd6taxbp4VpCBdxMr+tbyan1Q/LP2B6xOCafRCKPDI+htvdTQRW OuSpbAS4Wd86XyxeB0toaNf5flxNHsj8YY08DFVwKcSh0Um5lJwRH6vTQgZbboB47/3T vQ4w== X-Gm-Message-State: AOJu0Yzjm72oa3vcXD/pg1YOfkp1fHnIwoPJgmvO7PEuCBQ0+h/CM9Jm DDPgb+QwBop6EOPdJwg9BjCQVu7WcATCYYAe0ZC/F9XE+uFE/PE7ppR7Yw== X-Google-Smtp-Source: AGHT+IEgK89+6QBkQ0IE/czYjCVJC/ikZJt3haxiUtk3o9ujzxoqfDZEExaiaUC82IGkF8CTAFvJ+A== X-Received: by 2002:a17:906:bc12:b0:a86:ad3c:6d2d with SMTP id a640c23a62f3a-a90d5838cf6mr566233366b.61.1726944537947; Sat, 21 Sep 2024 11:48:57 -0700 (PDT) Received: from smtpclient.apple (ppp141237088007.access.hol.gr. [141.237.88.7]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b38e9sm1000712666b.118.2024.09.21.11.48.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Sep 2024 11:48:57 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3818.100.11.1.3\)) Subject: Re: Docs pg_restore: Shouldn't there be a note about -n ? From: Florents Tselai In-Reply-To: <2745562.1726942969@sss.pgh.pa.us> Date: Sat, 21 Sep 2024 21:48:45 +0300 Cc: pgsql-hackers Content-Transfer-Encoding: quoted-printable Message-Id: <7A215487-BCB5-44DA-9419-754A65DCB0AB@gmail.com> References: <284C4D55-4F90-4AA0-84C8-1E6A28DDF271@gmail.com> <2745562.1726942969@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3818.100.11.1.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 21 Sep 2024, at 9:22=E2=80=AFPM, Tom Lane = wrote: >=20 > Florents Tselai writes: >> Ah, swapped them by mistake on the previous email: >> They're both available in the pg_dump and note on -n missing in = pg_restore. >> The question remains though: >> Shouldn=E2=80=99t there be a note about -n in pg_restore ? >=20 > Probably. I see that pg_dump has a third copy of the exact same > note for "-e". pg_restore lacks that switch for some reason, > but this is surely looking mighty duplicative. I propose getting > rid of the per-switch Notes and putting a para into the Notes > section, along the lines of >=20 > When -e, -n, or -t is specified, pg_dump makes no attempt to dump > any other database objects that the selected object(s) might > depend upon. Therefore, there is no guarantee that the results of > a selective dump can be successfully restored by themselves into a > clean database. Agree with that, but I think there should be a pointer like =E2=80=9Csee = Notes=E2=80=9D . Otherwise I=E2=80=99m pretty sure most would expect pg doing magic. Can=E2=80=99t remember I scrolledl to the bottom of a page =E2=80=9Cnotes=E2= =80=9D after finding the option I want. I would also add an example of what =E2=80=9Cdepend upon=E2=80=9D means, To underline that it=E2=80=99s really not that uncommon. Something like:=20 =E2=80=9CIf you pg_dump only with -t A and A has foreign key constraints = to table B, Those constraints won=E2=80=99t succeed If B has not been already = restored=E2=80=9D=20 >=20 > and mutatis mutandis for pg_restore. >=20 > regards, tom lane