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 1rDn2N-0039J2-8A for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Dec 2023 14:50:07 +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 1rDn2L-0095r3-RT for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Dec 2023 14:50:05 +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 1rDn2L-0095qv-JH for pgsql-bugs@lists.postgresql.org; Thu, 14 Dec 2023 14:50:05 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rDn2J-00ByoG-BQ for pgsql-bugs@lists.postgresql.org; Thu, 14 Dec 2023 14:50:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3BEEo11f2781745; Thu, 14 Dec 2023 09:50:01 -0500 From: Tom Lane To: Julien Rouhaud cc: Daniel Gustafsson , mb.alzouabi@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18245: pg_restore accepts same output file name as input file name In-reply-to: References: <18245-eed25801b2d599c9@postgresql.org> Comments: In-reply-to Julien Rouhaud message dated "Thu, 14 Dec 2023 15:38:39 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2781743.1702565401.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 14 Dec 2023 09:50:01 -0500 Message-ID: <2781744.1702565401@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Julien Rouhaud writes: > On Wed, Dec 13, 2023 at 09:44:26AM +0100, Daniel Gustafsson wrote: >> Something like the attached (untested) sketch should be enough I think. > I'm wondering if it would be worth adding some canonicalize_path() calls= while > at it, ISTM that such mistakes are likely to happen when invoking pg_re= store > manually, so having slightly different wording for the exact same file w= ouldn't > surprising. I'm a little dubious about the value of this; but if we're going to do it, comparing post-canonicalize_path strings does seem like the right way. regards, tom lane