I have a tricky question about postgresql (9.5 in my case). For information, i use Odoo 9.0 (but this is not the subject).
I recently had to manually stop a working SQL transaction (a bug in our software made the whole transaction to last more than 1 day). Auto-commit was disabled (of course).
To do that, i used the "brute way" (i recently discovered that it was not recommended at all) :
kill -9 PID
I expected the transaction to "lose" its current modifications (even if a rollback wasn't made by postgresql, i thought the modifications would be lost).
But the fact is the transaction modifications seems to have been applied to the database (without any explicit COMMIT by my own).
My question is :
Do you know if postgresql usually acts this way (save transaction changes when the transaction process is being "hard"-killed) ?
Otherwise, it may be a "dark" part of our software ORM which does a COMMIT before being stopped / killed ^^
Of course not. Killing the backend or the client prior to an explicit COMMIT rolls back the transaction.
Otherwise, it may be a "dark" part of our software ORM which does a COMMIT before being stopped / killed ^^
One possibility. No one knows what the process you did was waiting for or doing. You lost the opportunity to introspect on that. In the future, you'll want to collect data in pg_activity
, and pg_locks
if it's a PostgreSQL backend process.
If it's a client, well it could be really doing anything then.