Loading...

Configuring the PostgreSQL Archive Log Directory

Archive log files are stored in the Archive Log directory. Ensure to follow the below checkpoints before running the PostgreSQL FS backup.

Procedure

  • Specify the Archive log directory path in the postgresql.conf file prior to performing the PostgreSQL FS backup. Make sure that this path does not point to pg_log or log directories and pg_xlog or pg_wal directories.

    archive_command = 'cp %p /opt/wal/%f' #UNIX
    archive_command = 'copy "%p" "D:\\PostgreSQL\\wal\\%f"' #Windows

  • For PostgreSQL 8.3 version and later, use the following configuration to turn on the archive_mode. This feature is not supported for PostgreSQL 8.2 and earlier versions.

    archive_mode = on

  • The archive_mode cannot be enabled when wal_level is set to minimal. Configure it based on the replication type for your instance.

    For a standalone instance, you may set it to archive or replica as applicable for your PostgreSQL version.

    For more information, refer PostgreSQL Documentation, Write Ahead Log.

  • Verify that the archive command provided in the postgresql.conf file is correct. You can test this by running the following commands and verifying that they successfully complete.

    Select pg_start_backup(‘Testing’);
    Select pg_stop_backup();

Last modified: 3/23/2022 9:46:42 AM