[rt-users] How to backup/dump Postgre SQL

Landon Stewart lstewart at internap.com
Fri Aug 5 15:12:15 EDT 2016

On Aug 5, 2016, at 4:05 AM, Martin Petersson <martin at uanet.se<mailto:martin at uanet.se>> wrote:


I need to backup or dump the database to a .bak file, it´s Request Tracker 4.0.7.
Frits i tried this:
root at rt:~# pg_dump rtdb > rtdb-backup
pg_dump: [archove (db)] connection against database "rtdb" failed: FATAL:  role "root" does not exist

Then i tried:
root at rt:~# su postgres
postgres at rt:/root$ pg_dump rtdb > rtdb-backup
bash: rtdb-backup: Access denied

What do i have to do to create a backup of the database?

Use 'su - postgres' instead to become postgres instead of just get the permissions of postgres.  If that doesn't work because it doesn't have a shell try sudo but ultimately you need to be in a place you can write to while having the permissions of postgres or specify the location in the redirect.

# su postgres
$ pg_dump rtdb -> /tmp/rtdb-backup

Landon Stewart
Lead Analyst - Abuse and Security Management
📧 lstewart at internap.com<mailto:lstewart at internap.com>
🌍 www.internap.com<http://www.internap.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20160805/8c8e4f28/attachment.html>

More information about the rt-users mailing list