Re: pgsql: Beautify initialization of JsonValueList and JsonLikeRegexContex - Mailing list pgsql-committers

From Alexander Korotkov
Subject Re: pgsql: Beautify initialization of JsonValueList and JsonLikeRegexContex
Date
Msg-id CAPpHfdtmREDU2eAT4gMDjJRJtFEvMU=tOOzWeeCAPMwofEDXJQ@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Beautify initialization of JsonValueList andJsonLikeRegexContex  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: pgsql: Beautify initialization of JsonValueList andJsonLikeRegexContex
List pgsql-committers
On Sun, Mar 17, 2019 at 3:00 PM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> On 2019-03-17 10:59, Alexander Korotkov wrote:
> > Beautify initialization of JsonValueList and JsonLikeRegexContext
> >
> > Instead of tricky assignment to {0} introduce special macros, which
> > explicitly initialize every field.
>
> To me, this patch is exactly the opposite of what I'd do to "beautify
> initialization".  It doesn't seem sustainable to me to create a special
> macro for every structure in the code, not does it improve readability.
> It is much clearer that {0} is uniformly the starting state.

I got two reasons in the mind while committing that:
1) We would probably like to make some values of empty state non-zero in future.
2) In general, it's better to not assume that NULL is binary zero.
However, we assume that a lot in other places.  So, it probably
doesn't matter.

Anyway, I thought about this as about just beautification.  If it's
bad idea, let's revert this.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pgsql: Beautify initialization of JsonValueList andJsonLikeRegexContex
Next
From: Michael Paquier
Date:
Subject: pgsql: Error out in pg_checksums on incompatible block size