Re: fix psql \conninfo & \connect when using hostaddr - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: fix psql \conninfo & \connect when using hostaddr
Date
Msg-id 20181109011414.GB2652@paquier.xyz
Whole thread Raw
In response to Re: fix psql \conninfo & \connect when using hostaddr  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: fix psql \conninfo & \connect when using hostaddr
List pgsql-hackers
On Thu, Nov 08, 2018 at 12:13:31PM -0300, Alvaro Herrera wrote:
> On 2018-Nov-08, Tom Lane wrote:
>> Visually, however, I think this is better off with braces because
>> it *looks* like a multi-line if-block.  The braces also make it
>> clear that your intent was not, say,
>>
>>     while (some-mutable-condition)
>>         /* skip */ ;
>>     do_something_else();
>
> Right, that too.  Fortunately I think compilers warn about mismatching
> indentation nowadays, at least in some cases.

I don't recall seeing a compiler warning about that, but I do recall
coverity complaining loudly about such things.  It is better style to
use braces if there is one line of code with a comment block in my
opinion.  And there is no need for braces if there is no comment.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: ON COMMIT actions and inheritance
Next
From: Thomas Munro
Date:
Subject: Strange corruption in psql output on mereswine