LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pg_receivewal

streams WAL from server to archive

TLDR

Receive WAL to a directory from a remote server
$ pg_receivewal -D [wal_dir] -h [host] -U [username]
copy
Receive using a replication slot
$ pg_receivewal -D [wal_dir] -S [slot_name] -h [host]
copy
Create a replication slot and exit
$ pg_receivewal -D [wal_dir] -S [slot_name] --create-slot -h [host]
copy
Receive with gzip compression
$ pg_receivewal -D [wal_dir] -Z [gzip:5] -h [host]
copy
Receive without looping on connection errors
$ pg_receivewal -D [wal_dir] -n -h [host]
copy

SYNOPSIS

pg_receivewal [options]

DESCRIPTION

pg_receivewal streams WAL from server to archive. Creates continuous WAL archive for point-in-time recovery. Alternative to archive_command for WAL archiving.

PARAMETERS

-D, --directory dir

WAL destination directory (required).
-h, --host host
Server hostname or socket directory.
-p, --port port
Server port number.
-U, --username name
Username to connect as.
-S, --slot name
Use a replication slot.
-Z, --compress method[:detail]
Compression method and optional level (gzip, lz4, or none).
-n, --no-loop
Don't retry on connection errors; exit immediately.
-s, --status-interval seconds
Seconds between status packets (default: 10).
-E, --endpos lsn
Stop replication at the specified LSN.
--create-slot
Create a new physical replication slot, then exit.
--drop-slot
Drop the named replication slot, then exit.
--if-not-exists
Don't error if slot already exists with --create-slot.
--synchronous
Flush WAL data to disk immediately after receipt.
--no-sync
Don't force WAL data to be flushed to disk.

SEE ALSO

Copied to clipboard
Kai