LinuxCommandLibrary

pg_resetwal

resets write-ahead log and control information

TLDR

Reset WAL (dry run)

$ pg_resetwal -n [data_dir]
copy
Reset WAL
$ pg_resetwal [data_dir]
copy
Force reset
$ pg_resetwal -f [data_dir]
copy

SYNOPSIS

pg_resetwal [options] [-D] datadir

DESCRIPTION

pg_resetwal resets write-ahead log and control information. Last resort recovery when WAL is corrupted. May cause data loss. Server must be stopped.

PARAMETERS

-D, --pgdata dir

Data directory.
-n, --dry-run
Show what would be done.
-f, --force
Force reset.
-e xid
Set next transaction ID.
-l walfile
Force minimum WAL starting location.

CAVEATS

Use only as last resort. May cause data loss. Server must be stopped.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community