Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
We should use UPSERT for accounting to Postgresql #2244
We currently have the config do manual
PostgreSQL 9.3 and later supports
The default configuration should be updated to use this.
For v3, the
For v4, the
We currently have the config do manual UPDATE, and if that fails, do INSERT. PostgreSQL 9.3 and later supports UPSERT: https://www.postgresql.org/docs/current/static/sql-insert.html
Yeah I thought this was new(ish). You used to have to use a stored procedure with a loop. If you wanted to do this server side.
The default configuration should be updated to use this. For v3, the UPSERT should be commented out by default. For v4, the UPSERT should be the default configuration. And the old-style INSERT / UPDATE should be commented out by default. UPSERT can likely increase performance in high load situations.