From 3d5cd9b2ff59170eda5ad82767c0cf1505589395 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 6 Mar 2020 05:48:39 +0000 Subject: [PATCH] only swap parts if a replacement is given --- route_sql/swap_post.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/route_sql/swap_post.sql b/route_sql/swap_post.sql index 518d69f..13bdc43 100644 --- a/route_sql/swap_post.sql +++ b/route_sql/swap_post.sql @@ -6,6 +6,8 @@ target AS (SELECT $$swap_doc$$::jsonb swap) FROM TARGET LEFT JOIN LATERAL jsonb_to_recordset(target.swap->'rows') AS x(original text, sales numeric, replace text, fit text)ON TRUE + WHERE + COALESCE(x.replace,'') <> '' ) --select * from pl ,seg AS (