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

2025-01-18 Thread Andrew Dunstan
On 2025-01-18 Sa 1:17 PM, Tom Lane wrote: Andrew Dunstan writes: Pushed something along these lines. In master I also added a code comment so nobody might be tempted to "fix" the anomaly. There is still a commitfest entry [1] pointing at this thread. Should it be closed as committed, or is t

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

2025-01-18 Thread Tom Lane
Andrew Dunstan writes: > Pushed something along these lines. In master I also added a code > comment so nobody might be tempted to "fix" the anomaly. There is still a commitfest entry [1] pointing at this thread. Should it be closed as committed, or is there more to do?

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

2025-01-03 Thread Andrew Dunstan
On 2024-12-09 Mo 11:16 AM, jian he wrote: On Mon, Dec 9, 2024 at 9:27 PM Yan Chengpeng 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

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

2024-12-09 Thread jian he
On Mon, Dec 9, 2024 at 9:27 PM Yan Chengpeng 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/

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

2024-12-09 Thread Yan Chengpeng
Subject: Re: [PATCH] Fix jsonb comparison for raw scalar pseudo arrays On Sun, Dec 8, 2024 at 10:58 PM Andrew Dunstan wrote: > > So the actual sort order as implemented is, AIUI, > > Object > Non-Empty-Array > Boolean > Number > String > Null > Empty-Array > >

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

2024-12-09 Thread Yan Chengpeng
: [PATCH] Fix jsonb comparison for raw scalar pseudo arrays On Sun, Dec 8, 2024 at 10:58 PM Andrew Dunstan wrote: > > So the actual sort order as implemented is, AIUI, > > Object > Non-Empty-Array > Boolean > Number > String > Null > Empty-Array > > which is ugly

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

2024-12-09 Thread jian he
On Sun, Dec 8, 2024 at 10:58 PM Andrew Dunstan wrote: > > So the actual sort order as implemented is, AIUI, > > Object > Non-Empty-Array > Boolean > Number > String > Null > Empty-Array > > which is ugly, but fortunately not many apps rely on jsonb sort order. > > Nobody else has commented, so I p

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

2024-12-08 Thread Andrew Dunstan
On 2024-12-03 Tu 9:11 AM, Andrew Dunstan wrote: On 2024-11-18 Mo 9:25 AM, Yan Chengpeng wrote: Dear PostgreSQL Hackers, *Problem Description* I encountered an issue with the B-Tree ordering of `jsonb` values. According to the PostgreSQL documentation[1], the ordering should follow this p

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

2024-12-03 Thread Andrew Dunstan
On 2024-11-18 Mo 9:25 AM, Yan Chengpeng wrote: Dear PostgreSQL Hackers, *Problem Description* I encountered an issue with the B-Tree ordering of `jsonb` values. According to the PostgreSQL documentation[1], the ordering should follow this precedence: `Object > Array > Boolean > Number > S

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

2024-11-29 Thread jian he
On Mon, Nov 18, 2024 at 10:25 PM Yan Chengpeng wrote: > > > I encountered an issue with the B-Tree ordering of `jsonb` values. According > to the PostgreSQL documentation[1], the ordering should follow this > precedence: > > `Object > Array > Boolean > Number > String > Null` > > > However, empt

[PATCH] Fix jsonb comparison for raw scalar pseudo arrays

2024-11-18 Thread Yan Chengpeng
Dear PostgreSQL Hackers, Problem Description I encountered an issue with the B-Tree ordering of `jsonb` values. According to the PostgreSQL documentation[1], the ordering should follow this precedence: `Object > Array > Boolean > Number > String > Null` However, empty arrays (`[]`) are current