Nordic PGDay
Stefan Fercot
(24 March 2020)
Support |
Training |
Advice |
--wal-segsize
initdb parameter to change itshared_buffers
pg_dump
pg_receivewal
(via Streaming Replication)postgresql.conf
)
wal_level = replica
archive_mode = on
or always
archive_command = '... some command ...'
archive_timeout = 0
pg_receivewal
pg_receivewal
pg_basebackup
pg_basebackup
pg_start_backup()
pg_stop_backup()
pg_start_backup()
SELECT pg_start_backup (
label
: arbitrary user-defined textfast
: immediate checkpoint?exclusive
: exclusive mode?)
pg_start_backup()
backup_label
, tablespace_map
pg_stop_backup()
pg_start_backup()
!backup_label
and tablespace_map
contentpostmaster.pid
, postmaster.opts
, pg_internal.init
log
, pg_wal
, pg_replslot
,…pg_stop_backup()
SELECT * FROM pg_stop_backup (
)
pg_switch_wal()
on the primary…pg_wal
directorypg_wal
(if not already the case)recovery.conf
postgresql.conf
+ recovery.signal
restore_command = '... some command ...'
pg_hba.conf
if neededIntegrate recovery.conf into postgresql.conf
recovery.conf settings are now set in postgresql.conf (or other GUC
sources). Currently, all the affected settings are PGC_POSTMASTER;
this could be refined in the future case by case.
Recovery is now initiated by a file recovery.signal. Standby mode is
initiated by a file standby.signal. The standby_mode setting is
gone. If a recovery.conf file is found, an error is issued.
...
pg_basebackup -R now appends settings to postgresql.auto.conf and
creates a standby.signal file.
# 2dedf4d9a899b36d1a8ed29be5efbd1b31a8fe85
recovery_target_name
, recovery_target_time
recovery_target_xid
, recovery_target_lsn
recovery_target_inclusive
recovery_target_timeline
recovery_target_action
pg_wal_replay_resume
.history
filesrecovery_target_timeline
latest
(v12+) or current
(< v12)archive_wal
pitrery
restore_wal
pg_receivewal
& pg_basebackup
supportarchive_command | restore_command | pg_receivewal |
|
---|---|---|---|
pgBackRest | YES (+ archive-async) |
YES (+ archive-async) |
NO |
pitrery | YES | YES | NO |
Barman | YES | YES | YES |
WAL-G | YES | YES (+ wal prefetch) |
NO |
method | ||
---|---|---|
pgBackRest | YES | aes-256-cbc |
pitrery | NO | |
Barman | NO | |
WAL-G | YES | S3 server-side / libsodium |
backup, restore | archiving | parameters | |
---|---|---|---|
pgBackRest | YES | YES | process-max |
pitrery | NO | NO | |
Barman | YES rsync | NO | parallel_jobs |
WAL-G | YES | YES | WALG_*_CONCURRENCY |
backups | archives | how? | |
---|---|---|---|
pgBackRest | YES | YES | gzip |
pitrery | YES tar | YES | gzip, pigz, bzip2,… |
Barman | NO | YES | gzip, pigz, bzip2,… |
WAL-G | YES | YES | lz4, lzma, brotli |
network compression | bandwidth limit | |
---|---|---|
pgBackRest | YES | NO |
pitrery | NO | YES rsync |
Barman | YES rsync | YES rsync |
WAL-G | NO | YES |
how? | ||
---|---|---|
pgBackRest | YES | --type=incr --type=diff |
pitrery | YES rsync | hardlinks |
Barman | YES rsync | hardlinks |
WAL-G | YES | WALG_DELTA_MAX_STEPS WALG_DELTA_ORIGIN |
pg_dump
]