Re: BUG #18245: pg_restore accepts same output file name as input file name

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: mb(dot)alzouabi(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18245: pg_restore accepts same output file name as input file name
Date: 2023-12-14 14:38:39
Message-ID: ZXsTb3HttMOyyBox@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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(at)postgresql(dot)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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-12-14 14:40:48 Re: BUG #18248: Expression is always zero
Previous Message Alexander Lakhin 2023-12-14 11:11:12 Re: BUG #18248: Expression is always zero