only increment fields by an interval that are actually dates

This commit is contained in:
Paul Trowbridge 2020-11-05 22:32:27 -05:00
parent 9e53758fd9
commit d6dbf54ec6

View File

@ -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