Re: Conflicting option checking in pg_restore

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Narayanan V <vnarayanan(dot)email(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Conflicting option checking in pg_restore
Date: 2018-10-28 21:02:02
Message-ID: E5D20934-D1BC-44E6-AA72-B1917BC46D7A@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 28 Oct 2018, at 19:42, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul Jungwirth 2018-10-28 21:29:11 Re: SQL:2011 PERIODS vs Postgres Ranges?
Previous Message Daniel Gustafsson 2018-10-28 20:52:13 Re: Conflicting option checking in pg_restore