Re: mogrify and indent features for jsonb - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: mogrify and indent features for jsonb
Date
Msg-id 553EBB1C.4040501@dunslane.net
Whole thread Raw
In response to Re: mogrify and indent features for jsonb  (Petr Jelinek <petr@2ndquadrant.com>)
Responses Re: mogrify and indent features for jsonb
List pgsql-hackers
On 04/27/2015 12:46 PM, Petr Jelinek wrote:
>
> Another thing I noticed now when reading the code again - you should 
> not be using braces when you only have one command in the code-block.
>

There's one exception I, at least, have to this rule, namely when 
there's a corresponding compound if or else. I personally find this 
unaesthetic to put it mildly:
   if (condition)       statement;   else   {       block of statements;   }



pgindent used to produce stuff like this, and you had to put a comment 
in the block to get around it, but we stopped that years ago, IIRC.

cheers

andrew




pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0, parser/executor stuff
Next
From: Dave Jones
Date:
Subject: Re: Temporal extensions