Re: [PATCH] Fix jsonb comparison for raw scalar pseudo arrays

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Yan Chengpeng <chengpeng_yan(at)outlook(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Fix jsonb comparison for raw scalar pseudo arrays
Date: 2024-12-09 16:16:00
Message-ID: CACJufxEeBcyvzVE=O6q1eRZ4fE6RUFAQOXnH=KgsfnTKPUS5mQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 9, 2024 at 9:27 PM Yan Chengpeng <chengpeng_yan(at)outlook(dot)com> wrote:
>
> Sorry, I uploaded the wrong file. I uploaded a new patch with the modified document. Please take a review. Thanks!
>
>
sorry. maybe i didn't mention it explicitly.
i mean something like:

diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/json.sgml
index 54648c459c..d9b24e413e 100644
--- a/doc/src/sgml/json.sgml
+++ b/doc/src/sgml/json.sgml
@@ -584,12 +584,13 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE
jdoc @@ '$.tags[*] == "qui"';
The <literal>btree</literal> ordering for <type>jsonb</type>
datums is seldom
of great interest, but for completeness it is:
<synopsis>
-<replaceable>Object</replaceable> > <replaceable>Array</replaceable>
> <replaceable>Boolean</replaceable> >
<replaceable>Number</replaceable> > <replaceable>String</replaceable>
> <replaceable>Null</replaceable>
+<replaceable>Object</replaceable> > <replaceable>Array</replaceable>
> <replaceable>Boolean</replaceable> >
<replaceable>Number</replaceable> > <replaceable>String</replaceable>
> <replaceable>null</replaceable>

<replaceable>Object with n pairs</replaceable> > <replaceable>object
with n - 1 pairs</replaceable>

<replaceable>Array with n elements</replaceable> > <replaceable>array
with n - 1 elements</replaceable>
</synopsis>
+ with the exception that (for historical reasons) an empty array
sorts less than <replaceable>null</replaceable>.
Objects with equal numbers of pairs are compared in the order:
<synopsis>
<replaceable>key-1</replaceable>, <replaceable>value-1</replaceable>,
<replaceable>key-2</replaceable> ...

Attachment Content-Type Size
v2_json_doc_update.diff text/x-patch 1.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2024-12-09 16:31:03 Re: Document NULL
Previous Message Andres Freund 2024-12-09 16:15:46 Re: FileFallocate misbehaving on XFS