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



Reply via email to