add upsert to balance rollforward

This commit is contained in:
Paul Trowbridge 2018-09-24 16:40:19 -04:00
parent 4edd759636
commit bf4dcedcdc

View File

@ -70,16 +70,19 @@ minmax AS (
) )
select * from rf select * from rf
) )
INSERT INTO
evt.bal
SELECT SELECT
acct acct
,id ,id
,dur
,obal ,obal
,debits ,debits
,credits ,credits
,cbal ,cbal
FROM FROM
bld bld
ORDER BY ON CONFLICT ON CONSTRAINT bal_pk DO UPDATE SET
acct obal = EXCLUDED.obal
,id ,debits = EXCLUDED.debits
,credits = EXCLUDED.credits
,cbal = EXCLUDED.cbal