pgsql: pgdump authentication


create  .pg_pass file on the root folder of the user that will run the pgsql command for example. /root or /user


touch /root/.pgpass


chmod 600 .pgpass


add the credentialas user and password that will be user on postgres

for example:




The format of the command is:

pg_dump -h -U $USER -Fc $DATABASE > /home/scripts/idempiere.sql


another backup format is:

pg_dump -h -U [user] -Fc -f [source_db].pgdump -d [database]


to restore

pg_restore -U [database]-d [target_database]  [source_db].pgdump

Leave a Reply

Your email address will not be published. Required fields are marked *