PostgreSQL trigger race condition updating a balance table from transactions
I have a financial system where users have tokens and can add transactions. The system has to calculate the balance and mean acquisition price of each token. Data integrity is of utmost importance in the system and it should be…