Number of times PostgreSQL database restarted
Based on the pg_log or any PG log files, using grep to match how many times of shutting down the database.

grep -rwn postgresql-2018-04-12.log -e "database system is shut down"


The output looks like as below


  postgresql-2018-04-12.log:9:2018-04-12 16:07:25 CEST LOG:  database
  system is shut down postgresql-2018-04-12.log:18:2018-04-12 16:08:18
  CEST LOG:  database system is shut down