Re: remaining sql/json patches

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Erik Rijkers <er(at)xs4all(dot)nl>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: remaining sql/json patches
Date: 2024-01-22 00:00:00
Message-ID: CACJufxHo1VVk_0th3AsFxqdMgjaUDz6s0F7+j9rYA3d=URw97A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

based on v35.
Now I only applied from 0001 to 0007.
For {DEFAULT expression ON EMPTY} | {DEFAULT expression ON ERROR}
restrict DEFAULT expression be either Const node or FuncExpr node.
so these 3 SQL/JSON functions can be used in the btree expression index.

I made some big changes on the doc. (see attachment)
list (json_query, json_exists, json_value) as a new <section2> may be
a good idea.

follow these two links, we can see the difference.
only apply v35, 0001 to 0007: https://v35-functions-json-html.vercel.app
apply v35, 0001 to 0007 plus my changes:
https://html-starter-seven-pied.vercel.app

minor issues:
+ Note that if the <replaceable>path_expression</replaceable>
+ is <literal>strict</literal>, an error is generated if it yields no
+ items, provided the specified <literal>ON ERROR</literal> behavior is
+ <literal>ERROR</literal>.

how about something like this:
+ Note that if the <replaceable>path_expression</replaceable>
+ is <literal>strict</literal> and <literal>ON ERROR</literal>
behavior is specified
+ <literal>ERROR</literal>, an error is generated if it yields no
+ items

+ <note>
+ <para>
+ SQL/JSON path expression can currently only accept values of the
+ <type>jsonb</type> type, so it might be necessary to cast the
+ <replaceable>context_item</replaceable> argument of these functions to
+ <type>jsonb</type>.
+ </para>
+ </note>
here should it be "SQL/JSON query functions"?

Attachment Content-Type Size
v35-0001-only-allow-Const-node-or-scalar-returning-fun.no-cfbot application/octet-stream 3.3 KB
v35-0001-refactor-json_value-json_query-js.sql_json_new_section application/octet-stream 13.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2024-01-22 00:10:48 Re: [PATCH] psql: \dn+ to show size of each schema (and \dA+ for AMs)
Previous Message Peter Smith 2024-01-21 23:49:59 Re: Guiding principle for dropping LLVM versions?