Re: SQL/JSON revisited

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, e(dot)indrupskaya(at)postgrespro(dot)ru
Subject: Re: SQL/JSON revisited
Date: 2023-01-17 13:31:23
Message-ID: CA+HiwqE9aeaOTvTZ4xP37ieS2TN6WsV2MrSha2qtzsF8gV229w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 28, 2022 at 4:28 PM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
>
> Hi,
>
> Rebased the SQL/JSON patches over the latest HEAD. I've decided to
> keep the same division of code into individual commits as that
> mentioned in the revert commit 2f2b18bd3f, squashing fixup commits in
> that list into the appropriate feature commits.
>
> The main difference from the patches as they were committed into v15
> is that JsonExpr evaluation no longer needs to use sub-transactions,
> thanks to the work done recently to handle type errors softly. I've
> made the new code pass an ErrorSaveContext into the type-conversion
> related functions as needed and also added an ExecEvalExprSafe() to
> evaluate sub-expressions of JsonExpr that might contain expressions
> that call type-conversion functions, such as CoerceViaIO contained in
> JsonCoercion nodes. ExecExprEvalSafe() is based on one of the patches
> that Nikita Glukhov had submitted in a previous discussion about
> redesigning SQL/JSON expression evaluation [1]. Though, I think that
> new interface will become unnecessary after I have finished rebasing
> my patches to remove subsidiary ExprStates of JsonExprState that we
> had also discussed back in [2].

And I've just finished doing that. In the attached updated 0004,
which adds the JsonExpr node, its evaluation code is now broken into
ExprEvalSteps to handle the subsidiary JsonCoercion and JsonBehavior
expression nodes that previously used ExprState for recursive
evaluation. Andres didn't like the latter as previously discussed at
[1].

I've also attached the patch that Elena has proposed as the patch
0011. I haven't managed to review it yet, though once I do, I'll
merge it into the main documentation patch 0009. Thanks Elena.

--
Thanks, Amit Langote
EDB: http://www.enterprisedb.com

[1] https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.de

Attachment Content-Type Size
v2-0003-IS-JSON-predicate.patch application/octet-stream 43.6 KB
v2-0005-SQL-JSON-functions.patch application/octet-stream 52.0 KB
v2-0001-Common-SQL-JSON-clauses.patch application/octet-stream 24.9 KB
v2-0002-SQL-JSON-constructors.patch application/octet-stream 147.4 KB
v2-0004-SQL-JSON-query-functions.patch application/octet-stream 196.6 KB
v2-0007-JSON_TABLE.patch application/octet-stream 99.7 KB
v2-0006-RETURNING-clause-for-JSON-and-JSON_SCALAR.patch application/octet-stream 10.2 KB
v2-0009-Documentation-for-SQL-JSON-features.patch application/octet-stream 47.7 KB
v2-0008-PLAN-clauses-for-JSON_TABLE.patch application/octet-stream 70.7 KB
v2-0010-Claim-SQL-standard-compliance-for-SQL-JSON-featur.patch application/octet-stream 2.8 KB
v2-0011-Proposed-reworking-of-SQL-JSON-documentaion.patch application/octet-stream 30.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2023-01-17 13:32:56 Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Previous Message Karl O. Pinc 2023-01-17 13:12:42 Re: doc: add missing "id" attributes to extension packaging page