]> 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 5671a35a2ced794e5ae4b74464a0ac8bb4850667..d7e345533ce10920620de24cb4221153a1b31238 100755 (executable)
@@ -12,7 +12,7 @@ $BODY$
         (
             SELECT ('{' || string_agg(to_json(key) || ':' || value, ',') || '}')
             FROM jsonb_each(a)
-            WHERE NOT to_json(key)::jsonb ? b
+            WHERE key <> b
         )
     , '{}')::jsonb;
 $BODY$