issues

invalid primary checkpoint record

After unclean shutdown:

user=,db=,app=,client= LOG:  invalid primary checkpoint record
user=,db=,app=,client= PANIC:  could not locate a valid checkpoint record

Postgresql running from official docker container.

Solution:

Prevent container from restarting:

docker-compose stop db
docker-compose.yml
services:
  db:
    image: postgres:12-alpine
    command: bash

run it interactively:

docker-compose run db

and reset WAL:

su postgres -c '/usr/local/bin/pg_resetwal -f /var/lib/postgresql/data'