Difference between revisions of "Backing up and restoring PostgreSQL database"
From Notes_Wiki
(Created page with "<yambe:breadcrumb>Postgresql_configuration|Postgresql configuration</yambe:breadcrumb> =Backing up and restoring PostgreSQL database= ==Backing up PostgreSQL database== To b...") |
m |
||
Line 1: | Line 1: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Postgresql configuration|PostgreSQL configuration]] > [[Backing up and restoring PostgreSQL database]] | |||
==Backing up PostgreSQL database== | ==Backing up PostgreSQL database== | ||
Line 17: | Line 16: | ||
Note that attempts to use 'pg_restore' to restore dump failed hence above method is suggested. | Note that attempts to use 'pg_restore' to restore dump failed hence above method is suggested. | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Postgresql configuration|PostgreSQL configuration]] > [[Backing up and restoring PostgreSQL database]] |
Latest revision as of 07:19, 6 March 2022
Home > CentOS > CentOS 6.x > PostgreSQL configuration > Backing up and restoring PostgreSQL database
Backing up PostgreSQL database
To backup PostgreSQL database use:
pg_dump -U <user-name> -d <database-name> > <file-name>
Restoring PostgreSQL database dump
To restore database dump use:
psql -U <user-name>l -d <database-name> < <file-name>
Note that attempts to use 'pg_restore' to restore dump failed hence above method is suggested.
Home > CentOS > CentOS 6.x > PostgreSQL configuration > Backing up and restoring PostgreSQL database