Skip to main content

Backup and restore in PostgreSQL

To take backup and restore in PostgreSQL database, use below commands.

Backup : pg_dump -U <userName> -f <backupLocation.sql> <dbName>

Restore : psql -d <dbName> -f <backupLocation.sql>

Comments

Post a Comment

Popular posts from this blog

Get all constraints in Oracle

 To get all the constraints created in Oracle database, use below query.              SELECT * FROM USER_CONSTRAINTS; If you want to get the constraints  created for a particular user then use below SQL query.              SELECT   *   FROM  USER_CONSTRAINTS where owner = 'userName';