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

From Tom Lane
Subject Re: fix psql \conninfo & \connect when using hostaddr
Date
Msg-id 19649.1541689232@sss.pgh.pa.us
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
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2018-Nov-08, Arthur Zakirov wrote:
>> I just meant something like this (additional "{", "}" braces):

> We omit braces when there's an individual statement.  (We do add the
> braces when we have a comment atop the individual statement, though, to
> avoid pgindent from doing a stupid thing.)

For the record --- I just checked, and pgindent will not mess up code like

    if (condition)
        /* comment here */
        do_something();

at least not as long as the comment is short enough for one line.
(If it's a multiline comment, it seems to want to put a blank line
in front of it, which is not very nice in this context.)

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();

            regards, tom lane


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: proposal: variadic argument support for least, greatest function
Next
From: Tomas Vondra
Date:
Subject: Re: shared-memory based stats collector