Skip to content

Commit 6540cc5

Browse files
committed
Fix vague comment in jsonb documentation
The sample query fails because of an attempt to update the key of a numeric. But the comment says it's just because of the missing object key. That's not correct because jsonb subscription automatically adds missing keys. Reported-by: Nikita Konev
1 parent 14d9b37 commit 6540cc5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

doc/src/sgml/json.sgml

+2-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,8 @@ SELECT ('[1, "2", null]'::jsonb)[1];
648648
UPDATE table_name SET jsonb_field['key'] = '1';
649649

650650
-- This will raise an error if any record's jsonb_field['a']['b'] is something
651-
-- other than an object. For example, the value {"a": 1} has no 'b' key.
651+
-- other than an object. For example, the value {"a": 1} has a numeric value
652+
-- of the key 'a'.
652653
UPDATE table_name SET jsonb_field['a']['b']['c'] = '1';
653654

654655
-- Filter records using a WHERE clause with subscripting. Since the result of

0 commit comments

Comments
 (0)