Re: [PATCH] Fix jsonb comparison for raw scalar pseudo arrays
Chengpeng Yan <chengpeng_yan@outlook.com>
From: Yan Chengpeng <chengpeng_yan@outlook.com>
To: jian he <jian.universality@gmail.com>, Andrew Dunstan <andrew@dunslane.net>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-12-09T13:27:49Z
Lists: pgsql-hackers
Attachments
- json-doc-update.patch (application/octet-stream)
Sorry, I uploaded the wrong file. I uploaded a new patch with the modified document. Please take a review. Thanks! From: Yan Chengpeng <chengpeng_yan@outlook.com> Date: Monday, December 9, 2024 at 21:22 To: jian he <jian.universality@gmail.com>, Andrew Dunstan <andrew@dunslane.net> Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org> Subject: Re: [PATCH] Fix jsonb comparison for raw scalar pseudo arrays If many people are already using this ‘wrong’ behavior. I agree to change the doc. I also think using ‘null’ may be a better choice. Thanks for your comments. From: jian he <jian.universality@gmail.com> Date: Monday, December 9, 2024 at 16:56 To: Andrew Dunstan <andrew@dunslane.net> Cc: Yan Chengpeng <chengpeng_yan@outlook.com>, pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org> Subject: Re: [PATCH] Fix jsonb comparison for raw scalar pseudo arrays On Sun, Dec 8, 2024 at 10:58 PM Andrew Dunstan <andrew@dunslane.net> 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 propose to apply this patch documenting the anomaly. > while at it. we can fix the appearance of jsonb null. since select jsonb 'Null'; select jsonb 'NULL'; will fail. so maybe change <replaceable>Null</replaceable> in <synopsis> section and <replaceable>NULL</replaceable> to <replaceable>null</replaceable>