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

Patrick Muldoon doon.bulk at inoc.net
Fri Aug 5 15:34:31 EDT 2016


> On Aug 5, 2016, at 7:05 AM, Martin Petersson <martin at uanet.se> wrote:
> 
> Hello, 
> 
> 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
> 

this is postgres permission error 


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

this is file local host file system permission error. 


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


you can use the -U and -p flags to specify username and password to pg_dump  so you don't need to worry about the su / sudo stuff 


cd /tmp 
pg_dump -U postgres rtdb > rtdb-backup

If your db required a password then you can specify the -p flag such as..

pg_dump -U postgres -p rtdb > rtdb-backup

and it will prompt you for it. 


-Patrick

--
Patrick Muldoon
Network/Software Engineer
INOC (http://www.inoc.net)

RAM DISK is not an installation procedure!




More information about the rt-users mailing list