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

Lines changed: 2 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy