Re: remaining sql/json patches - Mailing list pgsql-hackers

From Amit Langote
Subject Re: remaining sql/json patches
Date
Msg-id CA+HiwqG-V3O=j=v=Zq1czhKwrJEG1qnX5yTO9=MfVa-U7coVNQ@mail.gmail.com
Whole thread Raw
In response to Re: remaining sql/json patches  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
On Fri, Mar 29, 2024 at 6:59 PM jian he <jian.universality@gmail.com> wrote:
> On Fri, Mar 29, 2024 at 11:20 AM jian he <jian.universality@gmail.com> wrote:

Thanks for the reviews and the patch to add new test cases.

> Similarly, I am not sure of the description of "composite SQL/JSON item".
> by observing the following 3 examples:
> SELECT * FROM JSON_TABLE(jsonb'{"a": "z"}', '$.a' COLUMNS (js2 text
> format json PATH '$' omit quotes));
> SELECT * FROM JSON_TABLE(jsonb'{"a": "z"}', '$.a' COLUMNS (js2 text
> format json PATH '$'));
> SELECT * FROM JSON_TABLE(jsonb'{"a": "z"}', '$.a' COLUMNS (js2 text PATH '$'));
>
> i think, FORMAT JSON specification means that,
> if your specified type is text or varchar related AND didn't specify
> quotes behavior
> then FORMAT JSON produced output can be casted to json data type.
> so FORMAT JSON seems not related to array and records data type.

Hmm, yes, "composite" can sound confusing.  Maybe just drop the word?

I've taken care of most of your other comments.

I'm also attaching 0002 showing an attempt to salvage only NESTED PATH
but not the PLAN clause.  Still needs some polishing, like adding a
detailed explanation in JsonTablePlanNextRow() of when the nested
plans are involved, but thought it might be worth sharing at this
point.

I'll continue polishing 0001 with the hope to commit it early next week.

--
Thanks, Amit Langote

Attachment

pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: To what extent should tests rely on VACUUM ANALYZE?
Next
From: Amit Langote
Date:
Subject: Re: remaining sql/json patches