Re: pg_restore --format= option(without any value) should report an error as pg_dump is reporting an error - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: pg_restore --format= option(without any value) should report an error as pg_dump is reporting an error
Date
Msg-id abhbSpewJZz0H999@nathan
Whole thread Raw
In response to Re: pg_restore --format= option(without any value) should report an error as pg_dump is reporting an error  (Mahendra Singh Thalor <mahi6run@gmail.com>)
Responses Re: pg_restore --format= option(without any value) should report an error as pg_dump is reporting an error
List pgsql-hackers
On Sun, Mar 15, 2026 at 10:32:11PM +0530, Mahendra Singh Thalor wrote:
> Here, I am attaching an updated patch for the review. I removed the
> length check for host, port and format in pg_restore as we don't have
> check  in pg_dump also.

Looks generally reasonable to me.

> I think we don't need any test cases for host and port.

Why not?

> If we want to backpatch, then I can make patches for back branches but
> as of now, I am uploading a patch for master only.

-1 for back-patching.  --format seems to have been broken since pg_restore
was first committed in 2000 (commit 500b62b057), so I don't sense any
urgency here.  Not to mention that someone might be relying on the current
behavior.

> +command_fails_like(
> +    [ 'pg_restore', '-f -', '-F', 'p' ],
> +    qr/\Qpg_restore: error: archive format "p" is not supported; please use psql\E/,
> +    'pg_restore: unrecognized archive format p|plain');

How does this test relate to this change?

-- 
nathan



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Adding REPACK [concurrently]
Next
From: Zsolt Parragi
Date:
Subject: Re: Improve OAuth discovery logging