]> git.8kb.co.uk Git - postgresql/pg_jsonb_delete_op/commitdiff
Merge pull request #2 from schinckel/patch-2 master
authorGlyn Astill <glynastill@yahoo.co.uk>
Sat, 24 Jan 2015 08:10:56 +0000 (08:10 +0000)
committerGlyn Astill <glynastill@yahoo.co.uk>
Sat, 24 Jan 2015 08:10:56 +0000 (08:10 +0000)
Use array ALL() function, and remove json/jsonb casts

pg_jsonb_delete_op.sql

index 3a3c818352e5d11695d0cfb28ff50573bbd5ba3b..d7e345533ce10920620de24cb4221153a1b31238 100755 (executable)
@@ -31,7 +31,7 @@ $BODY$
         (
             SELECT ('{' || string_agg(to_json(key) || ':' || value, ',') || '}')
             FROM jsonb_each(a)
-            WHERE NOT to_json(key)::jsonb ?| b
+            WHERE key <> ALL(b)
         )
     , '{}')::jsonb;
 $BODY$