add upsert to balance rollforward
This commit is contained in:
parent
4edd759636
commit
bf4dcedcdc
@ -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
|
Loading…
Reference in New Issue
Block a user