Jsonb should always display leading zero

This commit is contained in:
gentle_hu
2023-03-01 11:45:02 +08:00
parent 9ca77f6327
commit e134f38892
3 changed files with 89 additions and 69 deletions

View File

@ -110,7 +110,7 @@ referenced column: jsonb
SELECT '0.1'::jsonb; -- OK
jsonb
-------
.1
0.1
(1 row)
SELECT '9223372036854775808'::jsonb; -- OK, even though it's too large for int8

View File

@ -54,9 +54,9 @@ DETAIL: Token "." is invalid.
CONTEXT: JSON data, line 1: -1.5e5....
referenced column: jsonb
select '-1.5e-5'::jsonb;
jsonb
----------
-.000015
jsonb
-----------
-0.000015
(1 row)
select '-1.5e+5'::jsonb;
@ -229,7 +229,7 @@ from cmpjsonb order by 1,2,3,4,5,6,7,8,9;
"" | [] | -1 | f | t | t | t | f | f
"a" | "b" | -1 | f | t | t | t | f | f
"a" | "cc" | -1 | f | t | t | t | f | f
"a" | -.586 | -1 | f | t | t | t | f | f
"a" | -0.586 | -1 | f | t | t | t | f | f
"aa" | "aa" | 0 | t | f | f | t | f | t
"s" | ["s"] | -1 | f | t | t | t | f | f
"true" | true | -1 | f | t | t | t | f | f
@ -291,7 +291,7 @@ from cmpjsonb order by 1,2,3,4,5,6,7,8;
"" | [] | f | t | t | t | f | f
"a" | "b" | f | t | t | t | f | f
"a" | "cc" | f | t | t | t | f | f
"a" | -.586 | f | t | t | t | f | f
"a" | -0.586 | f | t | t | t | f | f
"aa" | "aa" | t | f | f | t | f | t
"s" | ["s"] | f | t | t | t | f | f
"true" | true | f | t | t | t | f | f