Child pages
  • How to restore a Postgres database

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
gunzip -c ${BACKUP} | pg_restore -h localhost --username=${USER} -d ${DB} -W 

The user's password (entered just previously) needs to be entered again.

Remove the superuser

...

privileges

Code Block
languagebash
 sudosudo -u postgres psql << EOF
ALTER ROLE ${USER} NOSUPERUSER;
EOF