Category: pg_Backup
-
PostgreSQL Backup
pg_basebackup is used to take base backups of a running PostgreSQL database cluster. We can take hot-backup and the backup can be used for… 1. point-in-time recovery as the starting point for a log shipping or 2. streaming replication standby servers It makes a binary copy of the database cluster files, while making sure the system is…
-
PG Backup Dump
Types of DB backup · Logical BACKUP <pg_dump> · Physical Backup PG SQL Dump Three tasks we are going to do… Restoring a backup Performing a backup Scheduling a backup job to run daily at 1am Create acweb Database createdb acweb Download TestDB from gitHub wget https://github.com/linuxacademy/content-postgresql-deepdive/raw/master/acweb/acweb.tar Restore the downloaded…
-
pg_switch_wal()
pg_switch_wal() is a system function which forces PostgreSQL to switch to a new WAL file. pg_switch_wal() returns the end LSN + 1 of the old WAL file. However, if there has been no activity which generates WAL since the last WAL file switch, a switch will not be carried out and the start location of the current…
-
pg_restore
pg_restore restores a PostgreSQL database from an archive file created by pg_dump. pg_restore [connection-option…] [option…] [filename] Example: We have dumped a database called mydb into a custom-format dump file: pg_dump -Fc mydb > db.dump To drop the database and recreate it from the dump:…