From: glyn Date: Mon, 19 Jan 2015 09:00:21 +0000 (+0000) Subject: Revert "Use to_json rather than concatenating strings in where clause" X-Git-Url: https://git.8kb.co.uk/?a=commitdiff_plain;h=6417a479f6b63b2302511a38e6bfe402faf4121c;p=postgresql%2Fpg_jsonb_delete_op Revert "Use to_json rather than concatenating strings in where clause" This reverts commit 263aa2ca57f58c294adb05ba51649dd7c6edc14f. --- diff --git a/pg_jsonb_delete_op.sql b/pg_jsonb_delete_op.sql index 1d52515..5d6473b 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 ('{"' || key || '":' || value || '}')::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 ('{"' || key || '":' || value || '}')::jsonb ?| b ) , '{}')::jsonb; $BODY$ @@ -50,7 +50,7 @@ $BODY$ ( SELECT ('{' || string_agg(to_json(key) || ':' || value, ',') || '}') FROM jsonb_each(a) - WHERE NOT to_json(key || ':' || value)::jsonb <@ b + WHERE NOT ('{"' || key || '":' || value || '}')::jsonb <@ b ) , '{}')::jsonb; $BODY$