From ce7fb1c8d33d767d95ee2ef255473d49241c1f30 Mon Sep 17 00:00:00 2001 From: glyn Date: Mon, 19 Jan 2015 09:41:44 +0000 Subject: [PATCH] Infact there is no need to roll up values in where clause when deleteing by key --- pg_jsonb_delete_op.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pg_jsonb_delete_op.sql b/pg_jsonb_delete_op.sql index 86868ff..4f559c8 100755 --- a/pg_jsonb_delete_op.sql +++ b/pg_jsonb_delete_op.sql @@ -12,7 +12,7 @@ $BODY$ ( SELECT ('{' || string_agg(to_json(key) || ':' || value, ',') || '}') FROM jsonb_each(a) - WHERE NOT ('{' || to_json(key) || ':' || value || '}')::jsonb ? b + WHERE NOT to_json(key)::jsonb ? b ) , '{}')::jsonb; $BODY$ @@ -31,7 +31,7 @@ $BODY$ ( SELECT ('{' || string_agg(to_json(key) || ':' || value, ',') || '}') FROM jsonb_each(a) - WHERE NOT ('{' || to_json(key) || ':' || value || '}')::jsonb ?| b + WHERE NOT to_json(key)::jsonb ?| b ) , '{}')::jsonb; $BODY$ -- 2.39.2