data

Backup and restore of data in PostgreSQL

Backing up the data using pg_dump Consider a remote postgres instance like AWS RDS. To backup the data that is currently present in a database in that RDS server, we can use the following command pg_dump -U master_user -d blog_db -h dbhost.rds.amazonaws.com -vx -Fc > blog_export.pgsql The options v - Verbose output of the operation x - Do not dump privileges. This makes sure that the statements such as grant/revoke are not added.