diff options
author | Alexander Korotkov <akorotkov@postgresql.org> | 2021-03-09 18:16:03 +0300 |
---|---|---|
committer | Alexander Korotkov <akorotkov@postgresql.org> | 2021-03-09 18:16:03 +0300 |
commit | 6540cc517dd452874a4e0fb268aee9b92e5136c6 (patch) | |
tree | c799f79662bfeb806d4da631c97605ae73ba799e /doc/src | |
parent | 14d9b37607ad30c3848ea0f2955a78436eff1268 (diff) | |
download | postgresql-6540cc517dd452874a4e0fb268aee9b92e5136c6.tar.gz postgresql-6540cc517dd452874a4e0fb268aee9b92e5136c6.zip |
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
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/json.sgml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/json.sgml index e16dd6973d2..6ab836548b2 100644 --- a/doc/src/sgml/json.sgml +++ b/doc/src/sgml/json.sgml @@ -648,7 +648,8 @@ SELECT ('[1, "2", null]'::jsonb)[1]; UPDATE table_name SET jsonb_field['key'] = '1'; -- This will raise an error if any record's jsonb_field['a']['b'] is something --- other than an object. For example, the value {"a": 1} has no 'b' key. +-- other than an object. For example, the value {"a": 1} has a numeric value +-- of the key 'a'. UPDATE table_name SET jsonb_field['a']['b']['c'] = '1'; -- Filter records using a WHERE clause with subscripting. Since the result of |