Backing up and restoring PostgreSQL database

From Notes_Wiki
Revision as of 05:56, 18 January 2013 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb>Postgresql_configuration|Postgresql configuration</yambe:breadcrumb> =Backing up and restoring PostgreSQL database= ==Backing up PostgreSQL database== To b...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb>Postgresql_configuration|Postgresql configuration</yambe:breadcrumb>

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&gtl -d <database-name> < <file-name>

Note that attempts to use 'pg_restore' to restore dump failed hence above method is suggested.