Re: pg_receivexlog: spurious error message connecting to 9.3 - Mailing list pgsql-hackers

From Marco Nenciarini
Subject Re: pg_receivexlog: spurious error message connecting to 9.3
Date
Msg-id 56543546.70503@2ndquadrant.it
Whole thread Raw
In response to Re: pg_receivexlog: spurious error message connecting to 9.3  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pg_receivexlog: spurious error message connecting to 9.3  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Hi Robert,

On 17/11/15 20:10, Robert Haas wrote:
> On Tue, Nov 10, 2015 at 1:35 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
>> On 10 November 2015 at 01:47, Marco Nenciarini
>> <marco.nenciarini@2ndquadrant.it> wrote:
>>
>>> I've attached a little patch that removes the errors when connected to 9.3.
>>
>> Looks good to me. No point confusing users.
>>
>> The other callers of RunIdentifySystem are pg_basebackup and
>> pg_receivelogical.
>>
>> pg_basebackup doesn't ask for the db_name (passes null).
>>
>> pg_receivelogical handles it being null already (and if it didn't,
>> it'd die with or without this patch).
>>
>> pg_receivexlog expects it to be null and fails gracefully if it isn't.
>>
>> So this change just removes some pointless noise.
>
> The fprintf(stderr, ...) does not cause a non-local exit, so the
> "else" just after it should be deleted.  Otherwise, when that branch
> is taken, *db_name doesn't get initialized at all.
>
> Actually, I'd suggest doing it like the attached instead, which seems
> a bit tighter.
>

I agree, your patch is better.

Regards,
Marco

--
Marco Nenciarini - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
marco.nenciarini@2ndQuadrant.it | www.2ndQuadrant.it


pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [PROPOSAL] VACUUM Progress Checker.
Next
From: Kisung Kim
Date:
Subject: Re: problem with msvc linker - cannot build orafce