Re: remaining sql/json patches

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Himanshu Upadhyaya <upadhyaya(dot)himanshu(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Erik Rijkers <er(at)xs4all(dot)nl>, Andres Freund <andres(at)anarazel(dot)de>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: remaining sql/json patches
Date: 2024-03-29 14:01:05
Message-ID: CA+HiwqG-V3O=j=v=Zq1czhKwrJEG1qnX5yTO9=MfVa-U7coVNQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 29, 2024 at 6:59 PM jian he <jian(dot)universality(at)gmail(dot)com> wrote:
> On Fri, Mar 29, 2024 at 11:20 AM jian he <jian(dot)universality(at)gmail(dot)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 Content-Type Size
v47-0002-JSON_TABLE-Add-support-for-NESTED-columns.patch application/octet-stream 50.1 KB
v47-0001-Add-JSON_TABLE-function.patch application/octet-stream 128.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2024-03-29 14:03:14 Re: remaining sql/json patches
Previous Message Alexander Lakhin 2024-03-29 14:00:00 Re: To what extent should tests rely on VACUUM ANALYZE?