I use the archive_command
below to archive WAL files. Suppose I have touched the file archive_active
already. When will PostgreSQL execute the supplied archive_command
to archive WAL files?
I know we can use the function pg_switch_xlog()
to archive the WAL on demand, are there other trigger conditions?
PostgreSQL version: 9.3.0.
--postgresql.conf
archive_command = 'test ! -f /archive/pg93/archive_active || cp %p /archive/pg93/%f'
wal_level = hot_standby
archive_mode = on
--archive directory
[pg93@redhatB pg93]$ pwd
/archive/pg93
[pg93@redhatB pg93]$ ll
total 32M
-rw-------. 1 pg93 pg93 16M Oct 16 11:05 00000001000000000000007A
-rw-------. 1 pg93 pg93 16M Oct 16 11:07 00000001000000000000007B
-rw-rw-r--. 1 pg93 pg93 0 Oct 16 11:05 archive_active
wal_level
andarchive_mod
?