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.

postgres=#

Check the archive is enabled or disabled in PostgreSQL:

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

postgres=# show archive_mode;
 archive_mode
--------------
 off
(1 row)

postgres=# show archive_command;
 archive_command
-----------------
 (disabled)
(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)
Advertisement

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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.