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 3a3c818..d7e3455 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$