Postgresql – Explore postgres recovery log records

postgresql

I simulated a crash in Postgres in middle of a transaction by force closing the Postgres process, after running again the Postgres the data that was changed was recovered to last data before transaction start,thats correct behavior.
I want to see actual recovery logs that do this thing in Postgres.
I spend lots of time with log files in Postgres but didn't find anything related to recovery and it just shows this message when I force close Postgres:

unexpected EOF on client connection with an open transaction

anyone have an idea how I can get actual recovery logs in Postgres?
I searched all over the internet and did not find anything useful except WAL system that generates files that I think might have data that I want but I cannot open them? is there any way?

Best Answer

If it was the client that force-closed, not the server, then the server has not gone through recovery. The client going away in the middle of a transaction is the same thing as the client explicitly aborting the transaction.

Recovery is what happens when the server crashes. I think you have an incorrect mental model of how PostgreSQL handles transaction aborts. The old data is still there, simply because the transaction that would have rendered it invisible failed to commit. No explicit recovery is needed.