Loading topic
psql, know the difference between a database and a cluster, know where the data directory lives, and understand what a transaction is. It explains the two families of PostgreSQL backups and how to choose between them. Later chapters cover the tools in detail.7 min readpsql, work at a Linux command line, and know what roles, databases, and transactions are. It builds on the previous chapter's distinction between logical and physical backups. Here you will use pg_dump, the main logical backup tool, to back up one database.6 min readpg_dump against a database, as covered in the previous chapter. It also assumes you know basic psql usage. Here you will compare the four archive formats that pg_dump can write and learn how each one affects restore options, speed, and file size.5 min readpsql and the Linux shell, and that you know PostgreSQL has roles, databases, and a data directory. You should also have read the previous chapters on pg_dump and dump formats.6 min readpg_dump is a text file of SQL commands. You restore it by running that script with psql, so pg_restore is not involved. This chapter covers how that restore behaves, what goes wrong with it, and how to make it safe and verifiable. It assumes you can use psql, know th6 min readpsql and the Linux command line, and that you know what a PostgreSQL role and a transaction are. It also assumes you have made a custom-format or directory-format dump with pg_dump, as covered in the earlier chapters.5 min readpg_dump or pg_restore uses one CPU core and one connection, however large the server is. On a multi-hundred-gigabyte database this can turn a restore into an overnight job. The -j option runs several workers at once. This chapter covers how it works, what it needs, and where 6 min readpg_basebackup, what the options mean, and which mistakes make a backup unusable. It assumes you know what a data directory is, can use roles and psql, an6 min readpostgresql.conf and restart a server. The chapter explains how PostgreSQL copies its write-ahead log (WAL) to safe storage while it runs. A base backup alone only restores t6 min readpg_basebackup, and that WAL archiving is already on, as covered in the previous two chapters. You should also know where the data directory is and how to start and stop the server with your service manager.6 min readpg_dump, pg_restore and pg_basebackup as shown in the earlier chapters. It also assumes you know what WAL archiving and recovery.signal do, and that you have a second machine, container or scratch directory to restore into.6 min readpg_basebackup, WAL archiving, and point-in-time recovery (PITR) work, and you should be comfortable editing postgresql.conf and running commands as the postgres OS user. The chapter compares two tools that automate th5 min read