Skip to content

Instantly share code, notes, and snippets.

@superacidjax
Created October 2, 2013 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save superacidjax/6791483 to your computer and use it in GitHub Desktop.
Save superacidjax/6791483 to your computer and use it in GitHub Desktop.
Resetting PG Logs
$ pg_resetxlog /usr/local/var/postgres
pg_resetxlog: lock file "/usr/local/var/postgres/postmaster.pid" exists
Is a server running? If not, delete the lock file and try again.
$ rm /usr/local/var/postgres/postmaster.pid
$ pg_resetxlog /usr/local/var/postgres
The database server was not shut down cleanly.
Resetting the transaction log might cause data to be lost.
If you want to proceed anyway, use -f to force reset.
$ pg_resetxlog -f /usr/local/var/postgres
Transaction log reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment