Sunday, 21 January 2024

PostgreSQL: How to take Compressed Backup of Database?

 In this post, I am sharing few options of pg_dump for taking the compressed backup in PostgreSQL.

When your database size is increasing, you should demand compressed backup for saving the disk space and time both.

Few OSs also not supported the big size of the single file so we have to split the backup file into different files or we can go with compressed options.

PostgreSQL supports zlib compression. We can use -Fc option in pg_dump for taking a compressed backup, and it also has an advantage like we can restore table selectively.

Syntax:

Use pg_restore for restoring the database:

We can also use gzip option for compression:

No comments:

Post a Comment

Master and Slave - Sync check - PostgreSQL

  1) Run the below Query on Primary:- SELECT     pid,     usename,     application_name,     client_addr,     state,     sync_state,     sen...