1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Implement array version of jsonb_delete and operator

This makes it possible to delete multiple keys from a jsonb value by
passing in an array of text values, which makes the operaiton much
faster than individually deleting the keys (which would require copying
the jsonb structure over and over again.

Reviewed by Dmitry Dolgov and Michael Paquier
This commit is contained in:
Magnus Hagander
2017-01-18 21:37:59 +01:00
parent c22ecc6562
commit d00ca333c3
6 changed files with 120 additions and 1 deletions

View File

@ -10843,6 +10843,14 @@ table2-mapping
on their key value.</entry>
<entry><literal>'{"a": "b"}'::jsonb - 'a' </literal></entry>
</row>
<row>
<entry><literal>-</literal></entry>
<entry><type>text[]</type></entry>
<entry>Delete multiple key/value pairs or <emphasis>string</emphasis>
elements from left operand. Key/value pairs are matched based
on their key value.</entry>
<entry><literal>'{"a": "b", "c": "d"}'::jsonb - '{a,c}'::text[] </literal></entry>
</row>
<row>
<entry><literal>-</literal></entry>
<entry><type>integer</type></entry>