Re: 16beta2 SQL parser: different defaults on absent_on_null

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Martin Butter <martin(dot)butter(at)splendiddata(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: 16beta2 SQL parser: different defaults on absent_on_null
Date: 2023-07-14 08:29:53
Message-ID: 302258BE-ADAD-4884-9C30-F6243A156376@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 14 Jul 2023, at 07:53, Martin Butter <martin(dot)butter(at)splendiddata(dot)com> wrote:

> While adapting a Java implementation of the SQL parser, I noticed that in structures JsonArrayAgg, JsonArrayConstructor, JsonArrayQueryConstructor and JsonObjectConstrutor, the absent_on_null field defaults to TRUE.
> But in JsonObjectAgg, absent_on_null defaults to FALSE.
> Is that intentionally?

I would say so, an empty NULL|ABSENT ON NULL clause for arrays is defined as
true, while for objects it's defined as false (which is shared between both
json_object() and json_objectagg()).

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2023-07-14 08:35:42 Re: DROP DATABASE is interruptible
Previous Message Alvaro Herrera 2023-07-14 08:24:43 Re: Remove distprep