pg_wal
pg_wal
(in PostgreSQL 9.6 and earlier: pg_xlog
) earlier is the subdirectory of the main PostgreSQL data directory where WAL files are stored.
It also contains the subdirectory archive_status
.
Configuration parameters
Following configuration parameters affect the pg_wal
directory in some way:
archive_command
max_wal_size
min_wal_size
max_slot_wal_keep_size
(PostgreSQL 13 and later)wal_keep_size
(PostgreSQL 12 and earlier:wal_keep_segments
)
Following configuration parameters were present in PostgreSQL versions which are now EOL:
checkpoint_segments
(PostgreSQL 9.4 and earlier)
Functions
The following functions can be used to examine the contents of pg_wal
:
Utilities
initdb
When executing initdb
, a WAL directory location outside of the main data directory (e.g. on a different filesystem) can be specified with -X
/--waldir
(PostgreSQL 9.6 and earlier: -X
/--xlogdir
). A symbolic link from pg_wal
in the main data directory to the specified location.
pg_basebackup
When executing pg_basebackup
, a WAL directory location outside of the main data directory (e.g. on a different filesystem) can be specified with --waldir
(PostgreSQL 9.6 and earlier: --xlogdir
). A symbolic link is created from pg_wal
in the main data directory to the specified location.