First steps to diagnose the problem
Most common reasons PostgreSQL fails to start
Port 5432 already in use
Another process (possibly another PostgreSQL instance) is using port 5432. Find and stop it:
Data directory permissions problem
The service account (NetworkService) must have full control of the data directory. Check and fix permissions:
PostgreSQL log shows "could not create lock file"
A stale postmaster.pid lock file from a previous crash is preventing startup. Delete it carefully:
Windows Defender or antivirus blocking PostgreSQL
Windows Defender may block PostgreSQL from binding to its port or accessing data files. Add exclusions for the PostgreSQL binary and data directories: Windows Security → Virus & threat protection → Exclusions → Add an exclusion → Folder → select C:\Program Files\PostgreSQL.
Error: "invalid page in block" or data corruption
This indicates possible data corruption, often from an unclean shutdown (power loss, forced kill). First try: pg_resetwal to reset the write-ahead log (risky — may lose recent transactions). Better: restore from your most recent backup. This is why regular backups with pg_dump are essential.