json-doc-update.patch
application/octet-stream
Filename: json-doc-update.patch
Type: application/octet-stream
Part: 0
commit 6f4c911aa98b7ced0b8e93d36e222531cd4f1c87
Author: yanchengpeng <chengpeng_yan@outlook.com>
Date: Mon Dec 9 12:59:28 2024 +0000
docs: Clarify JSONB sorting for empty arrays
Added a note to the JSONB documentation explaining that empty arrays sort less than null, due to historical reasons. This provides better clarity on JSONB sorting rules.
diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/json.sgml
index 54648c459c..2870df34d8 100644
--- a/doc/src/sgml/json.sgml
+++ b/doc/src/sgml/json.sgml
@@ -590,6 +590,7 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] == "qui"';
<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> ...