[Cialug] Postgres backup

L. V. Lammert lvl at omnitec.net
Tue Jul 24 10:29:37 CDT 2012


Having a problem backing up a Postgres system, .. if it were MySQL NP, but
PG appears to not setup a root Role by default, and running the backup as
the postgres user (which works AS that user) chokes when launched from
root.

Except for the first and last lines, this works fine as user postgres:

su - postgres
pg_dumpall > /home/db_backup/db.sql
gzip -f /home/db_backup/db.sql
exit

Tried to add them to su properly to user postgres, but it DNW - it stops
in the postgres sub-shell, and when I exit it complains about no root
Role for pg-dumpall.

How does one properly dump a PG environment?

	TIA!

	Lee


More information about the Cialug mailing list