Skip to main content

Common database issue solutions

https://stackoverflow.com/questions/62422298/postgresql-pg-dump-for-invalid-page-in-block-database-does-not-work-properly

https://github.com/teslamate-org/teslamate/discussions/1622

https://stackoverflow.com/questions/67468768/postgres-11-replication-slot-file-has-wrong-magic-number

https://github.com/docker-library/postgres/issues/158

https://stackoverflow.com/questions/48197579/docker-postgres-invalid-primary-checkpoint-record/72640430#72640430

Identify the Corrupt Relation

The relation causing the issue is represented by base/16384/16392 in your error message. To identify which table or index this corresponds to:

  1. Use the PostgreSQL oid2name utility (replace 16392 with the relevant ID):
oid2name -f 16392

Alternatively, query pg_class in the database:

SELECT relname, relkind
FROM pg_class
WHERE relfilenode = 16392;
docker run -it -v <docker_volume_name>:<PGDATA_path> postgres:16 /bin/bash