Re: pgsql: Beautify initialization of JsonValueList and JsonLikeRegexContex

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: pgsql: Beautify initialization of JsonValueList and JsonLikeRegexContex
Дата
Msg-id CAPpHfdtmREDU2eAT4gMDjJRJtFEvMU=tOOzWeeCAPMwofEDXJQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgsql: Beautify initialization of JsonValueList andJsonLikeRegexContex  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: pgsql: Beautify initialization of JsonValueList andJsonLikeRegexContex  (Michael Paquier <michael@paquier.xyz>)
Список 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 по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: pgsql: Beautify initialization of JsonValueList andJsonLikeRegexContex
Следующее
От: Michael Paquier
Дата:
Сообщение: pgsql: Error out in pg_checksums on incompatible block size