pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: mb.alzouabi@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18245: pg_restore accepts same output file name as input file name
Date: Thu, 14 Dec 2023 15:38:39 +0100
Message-ID: <ZXsTb3HttMOyyBox@jrouhaud> (raw)
In-Reply-To: <E7AEB7F8-BB3E-403F-ACDB-E06AF4E37861@yesql.se>
References: <18245-eed25801b2d599c9@postgresql.org>
	<E7AEB7F8-BB3E-403F-ACDB-E06AF4E37861@yesql.se>

Hi,

On Wed, Dec 13, 2023 at 09:44:26AM +0100, Daniel Gustafsson wrote:
> > On 13 Dec 2023, at 04:39, PG Bug reporting form <noreply@postgresql.org> wrote:
>
> > Please let it fail when the user passes the same name for the output as the
> > input.
>
> I think this sounds like a fair restriction, input and output being the same
> seems much more likely to be a copy/paste issue than an interesting usecase.

+1

> 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_restore
manually, so having slightly different wording for the exact same file wouldn't
surprising.





view thread (4+ messages)  latest in thread

Message-ID: <ZXsTb3HttMOyyBox@jrouhaud>
Permalink:  ../ZXsTb3HttMOyyBox@jrouhaud/
Also on:    postgresql.org/message-id/ZXsTb3HttMOyyBox@jrouhaud

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: rjuju123@gmail.com, daniel@yesql.se, 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: <ZXsTb3HttMOyyBox@jrouhaud>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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