From d6dbf54ec6e81e519a0139f6a964c02f820f8f4b Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 5 Nov 2020 22:32:27 -0500 Subject: [PATCH] only increment fields by an interval that are actually dates --- sql/col_interval.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/col_interval.sql b/sql/col_interval.sql index 176004d..e9294f6 100644 --- a/sql/col_interval.sql +++ b/sql/col_interval.sql @@ -7,7 +7,7 @@ BEGIN -------------------------------build a column list---------------------------------------- SELECT string_agg( - format('%I',cname) || CASE WHEN func IN ('odate','sdate') THEN ' + interval ''1 year''' ELSE '' END,E'\n,' ORDER BY opos ASC) + format('%I',cname) || CASE WHEN func IN ('odate','sdate') AND dtype = 'date' THEN ' + interval ''1 year''' ELSE '' END,E'\n,' ORDER BY opos ASC) INTO clist FROM