Re: More new SQL/JSON item methods

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Chapman Flack <chap(at)anastigmatix(dot)net>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: More new SQL/JSON item methods
Date: 2023-09-01 00:50:43
Message-ID: 2f30c2f8-cce0-4ced-335f-c57f85b8f419@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/30/23 19:20, Chapman Flack wrote:
> On 2023-08-30 12:28, Alvaro Herrera wrote:
>>         b) Otherwise, the result of JAE is the SQL/JSON sequence V_1,
>>            ..., V_n.
>
> This has my Spidey sense tingling, as it seems very parallel to SQL/XML
> where the result of XMLQUERY is to have type XML(SEQUENCE), which is a
> type we do not have, and I'm not sure we have a type for "JSON sequence"
> either, unless SQL/JSON makes it equivalent to a JSON array (which
> I guess is conceivable, more easily than with XML). What does SQL/JSON
> say about this SQL/JSON sequence type and how it should behave?

The SQL/JSON data model comprises SQL/JSON items and SQL/JSON sequences.
The components of the SQL/JSON data model are:

— An SQL/JSON item is defined recursively as any of the following:
• An SQL/JSON scalar, defined as a non-null value of any of the
following predefined (SQL) types: character string with character
set Unicode, numeric, Boolean, or datetime.
• An SQL/JSON null, defined as a value that is distinct from any
value of any SQL type. NOTE 109 — An SQL/JSON null is distinct
from the SQL null value.
• An SQL/JSON array, defined as an ordered list of zero or more
SQL/JSON items, called the SQL/JSON elements of the SQL/JSON
array.
• An SQL/JSON object, defined as an unordered collection of zero or
more SQL/JSON members, where an SQL/JSON member is a pair whose
first value is a character string with character set Unicode and
whose second value is an SQL/JSON item. The first value of an
SQL/JSON member is called the key and the second value is called
the bound value.

— An SQL/JSON sequence is an ordered list of zero or more SQL/JSON
items.

--
Vik Fearing

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2023-09-01 00:57:25 Re: sandboxing untrusted code
Previous Message David Steele 2023-08-31 22:50:29 Re: trying again to get incremental backup