Re: Conflicting option checking in pg_restore
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Daniel Gustafsson <daniel@yesql.se>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2018-10-30T02:39:31Z
Lists: pgsql-hackers
On Mon, Oct 29, 2018 at 07:11:35AM +0100, Fabien COELHO wrote: > Michaël suggests that there is no issue of external tool using the internal > function, so I'm fine with this version. > > I have switched the patch to ready for committer. One catch with this refactoring is that for example this combination does not result in an error on HEAD, but it does with the patch: pg_restore -l -C -1 Anyway, the fact that we save the caller from one exit_horribly() knowing that opening the archive is completely useless makes the move worth it in my opinion. RestoreArchive should complain about things which depend on the opened archive, which is the only thing it does now. I would not risk back-patching it though. At the same time, I have checked the set of TAP tests for pg_restore and the cross-option checks are all covered, so no need to go crazy on this side. For the archive's sake, the original commit 3a819b07 which did the option check in RestoreArchive comes from here: https://www.postgresql.org/message-id/496B6B40.1010909@hagander.net And committed, thanks Daniel and Fabien! -- Michael
Commits
-
Consolidate cross-option checks in pg_restore
- c34bca9ea55e 12.0 landed
-
Throw an error when using -C and -1 at the same time in pg_restore.
- 3a819b078036 8.4.0 cited