diff options
| author | Andrew Dunstan <andrew@dunslane.net> | 2015-06-07 20:46:00 -0400 |
|---|---|---|
| committer | Andrew Dunstan <andrew@dunslane.net> | 2015-06-07 20:46:00 -0400 |
| commit | b81c7b4098f52e64df89efe1461ba00a54649a10 (patch) | |
| tree | 924db92137a235ef088724a3a967799f13da38a8 /src/test/regress/sql | |
| parent | d23a3a603b8eed5e8e34b193d43e9ca5f380ef3f (diff) | |
| download | postgresql-b81c7b4098f52e64df89efe1461ba00a54649a10.tar.gz | |
Desupport jsonb subscript deletion on objects
Supporting deletion of JSON pairs within jsonb objects using an
array-style integer subscript allowed for surprising outcomes. This was
mostly due to the implementation-defined ordering of pairs within
objects for jsonb.
It also seems desirable to make jsonb integer subscript deletion
consistent with the 9.4 era general purpose integer subscripting
operator for jsonb (although that operator returns NULL when an object
is encountered, while we prefer here to throw an error).
Peter Geoghegan, following discussion on -hackers.
Diffstat (limited to 'src/test/regress/sql')
| -rw-r--r-- | src/test/regress/sql/jsonb.sql | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/test/regress/sql/jsonb.sql b/src/test/regress/sql/jsonb.sql index 2abec221b4..29c82a2a62 100644 --- a/src/test/regress/sql/jsonb.sql +++ b/src/test/regress/sql/jsonb.sql @@ -738,15 +738,6 @@ select '["a","b","c"]'::jsonb - -2; select '["a","b","c"]'::jsonb - -3; select '["a","b","c"]'::jsonb - -4; -select '{"a":1, "b":2, "c":3}'::jsonb - 3; -select '{"a":1, "b":2, "c":3}'::jsonb - 2; -select '{"a":1, "b":2, "c":3}'::jsonb - 1; -select '{"a":1, "b":2, "c":3}'::jsonb - 0; -select '{"a":1, "b":2, "c":3}'::jsonb - -1; -select '{"a":1, "b":2, "c":3}'::jsonb - -2; -select '{"a":1, "b":2, "c":3}'::jsonb - -3; -select '{"a":1, "b":2, "c":3}'::jsonb - -4; - select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{n}', '[1,2,3]'); select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{b,-1}', '[1,2,3]'); select jsonb_set('{"n":null, "a":1, "b":[1,2], "c":{"1":2}, "d":{"1":[2,3]}}'::jsonb, '{d,1,0}', '[1,2,3]'); @@ -775,7 +766,7 @@ select '"a"'::jsonb - 'a'; -- error select '{}'::jsonb - 'a'; select '[]'::jsonb - 'a'; select '"a"'::jsonb - 1; -- error -select '{}'::jsonb - 1 ; +select '{}'::jsonb - 1; -- error select '[]'::jsonb - 1; select '"a"'::jsonb - '{a}'::text[]; -- error select '{}'::jsonb - '{a}'::text[]; |
