Postgres: Restore

(Last Updated On: )

Restoring a postgres instance is rather straight forward. If you have a better way please feel free to let me know.

pg_restore -c --if-exists -Fd -h ##SERVERNAME## -p ##SERVERPORT## -U ##USER## -d ##DB_NAME## -v ##FILENAME_W_PATH## > ##OUTPUT_DIR## 2>&1
  1. -Fc: Instructs how the data was compressed for restoring.
  2. -Fd: Instructs that the data was compressed by directory for restoring.
  3. –if-exists: Used with -c