views:

98

answers:

2

How to create a backup of an POSTGRES DB using bash?

A: 

Use pg_dump.

Pablo Santa Cruz
I have difficulties including the username and password with pg_dump
Roland
+4  A: 
pg_dump -U some_user_name -f dump.file -Fc database_name

That's all.

If you need to authenticate with password - use pgpass file.

depesz