DBA Hub

📋Steps in this guide1/1

How to enable archiving(wal) in postgres

STEPS FOR enabling archiving:

postgresql configurationintermediate
by PostgreSQL
14 views
1

How to enable archiving(wal) in postgres

STEPS FOR enabling archiving: 1. Create directory for archiving: 2. Update the postgres.conf file with below values 3. Restart the postgres servers 3. Check archive status: postgres=# select name,setting from pg_settings where name like 'archive%'; name             | setting -----------------+-------------------------------------------------------------------------------------------------- archive_command  | test ! -f /Library/PostgreSQL/10/data/archive/%f && cp %p /Library/PostgreSQL/10/data/archive/%f archive_mode     | on archive_timeout  |  0

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
mkdir -p /Library/PostgreSQL/10/data/archive/
wal_level = replica
archive_mode = on
max_wal_senders=1
archive_command= 'test ! -f /Library/PostgreSQL/10/data/archive/%f && cp %p /Library/PostgreSQL/10/data/archive/%f'
export PGDATA=/Library/PostgreSQL/10/data
pg_ctl stop
pg_ctl start

Comments (0)

Please to add comments

No comments yet. Be the first to comment!