Check archive is enabled or disabled in PostgreSQL

Check archive is enabled or disabled in PostgreSQL Server

Connect with the PostgreSQL Database:

C:\Program Files\PostgreSQL\15\bin>psql -U postgres
Password for user postgres:
psql (15.2)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.


Check the archive is enabled or disabled in PostgreSQL:

Show archive mode is off means disabled, on means enabled.

postgres=# show archive_mode;
(1 row)

postgres=# show archive_command;
(1 row)

Another way to check:

postgres=# select name,setting from pg_settings where name like 'archive%';

          name           |  setting
 archive_cleanup_command |
 archive_command         | (disabled)
 archive_library         |
 archive_mode            | off
 archive_timeout         | 0
(5 rows)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.