2022-04-20 23:57:19 -04:00
|
|
|
[postgresql.org](https://www.postgresql.org/docs/current/app-pgrestore.html)
|
|
|
|
|
2022-04-20 23:53:53 -04:00
|
|
|
pg_restore has 2 modes. if you just feed it a backup file it produces sql that you woudl have to pipe to psql or a file to run.
|
|
|
|
If you specify -d it will actually connect and execute the restore commands.
|
|
|
|
|
|
|
|
-C combined with -c will drop and create a new database to restore into
|
|
|
|
-O will not assign ownership to the original owner, but whoever is connecting instead
|
|
|
|
|
|
|
|
sample restore command:
|
|
|
|
|
|
|
|
`pg_restore -O -C -c -U ptrowbridge -p 5433 -d ubm -h localhost ubm.backup`
|