Re: mogrify and indent features for jsonb

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Petr Jelinek <petr(at)2ndquadrant(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: mogrify and indent features for jsonb
Date: 2015-04-27 22:41:32
Message-ID: 553EBB1C.4040501@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Jones 2015-04-27 23:08:45 Re: Temporal extensions
Previous Message Peter Geoghegan 2015-04-27 22:28:43 Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0, parser/executor stuff