commands.sh

pg_receivewal

all

Stream the write-ahead log from a running PostgreSQL cluster.

More info →

Options (10)

-D, --directoryboolean

Stream WAL to a local directory (minimum required)

Example: pg_receivewal {{[-D|--directory]}} {{directory}}
-v, --verboseboolean

Same as above, specify host, port, username including verbose output

Example: pg_receivewal {{[-v|--verbose]}} {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}} {{[-D|--directory]}} {{directory}}
-h, --hostboolean

Same as above, specify host, port, username including verbose output

Example: pg_receivewal {{[-v|--verbose]}} {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}} {{[-D|--directory]}} {{directory}}
-p, --portboolean

Same as above, specify host, port, username including verbose output

Example: pg_receivewal {{[-v|--verbose]}} {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}} {{[-D|--directory]}} {{directory}}
-U, --usernameboolean

Same as above, specify host, port, username including verbose output

Example: pg_receivewal {{[-v|--verbose]}} {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}} {{[-D|--directory]}} {{directory}}
-S, --slotboolean

Use replication slot (create-if-needed)

Example: pg_receivewal {{[-S|--slot]}} {{slot_name}} --create-slot {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}} {{[-D|--directory]}} {{directory}}
-E, --endposboolean

Stop at a given WAL position (LSN)

Example: pg_receivewal {{[-E|--endpos]}} {{lsn}} {{[-D|--directory]}} {{directory}} {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}}
-n, --no-loopboolean

Control looping on failure

Example: pg_receivewal {{[-n|--no-loop]}} {{[-D|--directory]}} {{directory}} {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}}
-Z, --compressboolean

Compress WAL output (gzip, level 0-9)

Example: pg_receivewal {{[-Z|--compress]}} {{level|method}} {{[-D|--directory]}} {{directory}} {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}}
-s, --status-intervalboolean

Set status reporting interval

Example: pg_receivewal {{[-s|--status-interval]}} {{seconds}} {{[-D|--directory]}} {{directory}} {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}}

Examples (8)

Stream WAL to a local directory (minimum required)

pg_receivewal [-D|--directory] directory

Same as above, specify host, port, username including verbose output

pg_receivewal [-v|--verbose] [-h|--host] host [-p|--port] port [-U|--username] username [-D|--directory] directory

Use replication slot (create-if-needed)

pg_receivewal [-S|--slot] slot_name --create-slot [-h|--host] host [-p|--port] port [-U|--username] username [-D|--directory] directory

Stop at a given WAL position (LSN)

pg_receivewal [-E|--endpos] lsn [-D|--directory] directory [-h|--host] host [-p|--port] port [-U|--username] username

Control looping on failure

pg_receivewal [-n|--no-loop] [-D|--directory] directory [-h|--host] host [-p|--port] port [-U|--username] username

Flush data synchronously (force WAL writes immediately)

pg_receivewal --synchronous [-D|--directory] directory [-h|--host] host [-p|--port] port [-U|--username] username

Compress WAL output (gzip, level 0-9)

pg_receivewal [-Z|--compress] level|method [-D|--directory] directory [-h|--host] host [-p|--port] port [-U|--username] username

Set status reporting interval

pg_receivewal [-s|--status-interval] seconds [-D|--directory] directory [-h|--host] host [-p|--port] port [-U|--username] username
made by @shridhargupta | data from tldr-pages