Re: Conflicting option checking in pg_restore
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Narayanan V <vnarayanan.email@gmail.com>,
pgsql-hackers@postgresql.org
Date: 2018-10-28T21:02:02Z
Lists: pgsql-hackers
> On 28 Oct 2018, at 19:42, Fabien COELHO <coelho@cri.ensmp.fr> wrote: >>> Function RestoreArchive is called both from pg_dump & pg_restore, so now >>> the sanity check is not performed for the former (which does not have the >>> -1 option, though). Moreover, the function is noted "Public", which may >>> suggest that external tools could take advantage of it, and if so it >>> suggests that maybe it is not wise to remove the test. Any opinion around? >> >> [...] >> >> Wouldn't ropt->single_txn be undefined when called from pg_dump ? > > Yes, probably. pg_dump creates the RestoreOptions struct with NewRestoreOptions() which allocates it with pg_malloc0(), making single_txn false. cheers ./daniel
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