[PATCH] Remove redundant if clause in standbydesc.c

Lists: pgsql-hackers
From: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] Remove redundant if clause in standbydesc.c
Date: 2016-09-23 09:08:14
Message-ID: 20160923090814.GB1238@e733
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Hello.

Very simple small patch - see attachment.

--
Best regards,
Aleksander Alekseev

Attachment Content-Type Size
patch-1.patch text/x-diff 677 bytes

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Remove redundant if clause in standbydesc.c
Date: 2016-09-23 09:35:01
Message-ID: CAB7nPqTbAXzCVDpk=jJz9R=C9ZuBsZcjN1m4-Nq4J7t3RMGOkg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Sep 23, 2016 at 6:08 PM, Aleksander Alekseev
<a(dot)alekseev(at)postgrespro(dot)ru> wrote:
> Very simple small patch - see attachment.

/* not expected, but print something anyway */
else if (msg->id == SHAREDINVALRELMAP_ID)
- appendStringInfoString(buf, " relmap");
- else if (msg->id == SHAREDINVALRELMAP_ID)
appendStringInfo(buf, " relmap db %u", msg->rm.dbId);

Looking at inval.c, dbId can be InvalidOid.
--
Michael


From: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Remove redundant if clause in standbydesc.c
Date: 2016-09-23 09:54:31
Message-ID: 20160923095431.GD1238@e733
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

> > Very simple small patch - see attachment.
>
> /* not expected, but print something anyway */
> else if (msg->id == SHAREDINVALRELMAP_ID)
> - appendStringInfoString(buf, " relmap");
> - else if (msg->id == SHAREDINVALRELMAP_ID)
> appendStringInfo(buf, " relmap db %u", msg->rm.dbId);
>
> Looking at inval.c, dbId can be InvalidOid.

Frankly I'm not very familiar with this part of code. InvalidOid is just
zero. Does it create some problem in this case?

--
Best regards,
Aleksander Alekseev


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Remove redundant if clause in standbydesc.c
Date: 2016-09-23 13:46:10
Message-ID: CAB7nPqREvpH6Ex5nKYdkPmkP3iVWW1UHo_1KwsP=kR69OF3=aQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Sep 23, 2016 at 6:54 PM, Aleksander Alekseev
<a(dot)alekseev(at)postgrespro(dot)ru> wrote:
>> > Very simple small patch - see attachment.
>>
>> /* not expected, but print something anyway */
>> else if (msg->id == SHAREDINVALRELMAP_ID)
>> - appendStringInfoString(buf, " relmap");
>> - else if (msg->id == SHAREDINVALRELMAP_ID)
>> appendStringInfo(buf, " relmap db %u", msg->rm.dbId);
>>
>> Looking at inval.c, dbId can be InvalidOid.
>
> Frankly I'm not very familiar with this part of code. InvalidOid is just
> zero. Does it create some problem in this case?

Not really but my guess is that the two conditions have been left for
this purpose.
--
Michael


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Remove redundant if clause in standbydesc.c
Date: 2016-09-23 14:38:57
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> On Fri, Sep 23, 2016 at 6:54 PM, Aleksander Alekseev
> <a(dot)alekseev(at)postgrespro(dot)ru> wrote:
>>> Very simple small patch - see attachment.
>>>
>>> /* not expected, but print something anyway */
>>> else if (msg->id == SHAREDINVALRELMAP_ID)
>>> - appendStringInfoString(buf, " relmap");
>>> - else if (msg->id == SHAREDINVALRELMAP_ID)
>>> appendStringInfo(buf, " relmap db %u", msg->rm.dbId);

> Not really but my guess is that the two conditions have been left for
> this purpose.

I think it's a pretty obvious copy-and-pasteo.

regards, tom lane