How it works...
We need to first find the most recent log file. The ls command's -t parameter will sort the data by the last modified time, which the head command limits to one line of results. Distributions that provide PostgreSQL may adhere to a log-rotation scheme instead. In these cases, the latest log file will reside in /var/log/postgresql and will always have the same name. Older logs will have a number appended until the retention period passes.
No matter how we locate the most recent log file, we use two relatively simple commands to examine its contents. These log files can be extremely useful, though we will focus on the checkpoint activity for now. Of those two commands, the first simply isolates all the checkpoint data in the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access