You have to use following command to take backup :
You can use below command to take backup of postgresql database.
You can use this command to restore database
You can use below command to take backup of postgresql database.
Code:
pg_dump mydb > db.out
Code:
psql -d database -f db.out