Postgresql – wal_level set to replica at database level but i dont see that in configuration file


wal_level is commented in postgresql.conf and i dont see any entry in auto.conf either. but at the databsae level i see its set to REPLICA. Is there any other place whee it could have been set?

postgres@postgresqlmaster:/etc/postgresql/12/data$ psql -p 5433
psql (12.3 (Ubuntu 12.3-1.pgdg18.04+1))
Type "help" for help.

postgres=# select name, setting, sourcefile, sourceline from pg_settings where name = 'wal_level';
   name    | setting | sourcefile | sourceline
 wal_level | replica |            |
(1 row)

postgres@postgresqlmaster:/etc/postgresql/12/data$ cat /var/lib/postgresql/12/data/
# Do not edit this file manually!
# It will be overwritten by the ALTER SYSTEM command.
listen_addresses = '*'
shared_buffers = '200MB'
synchronous_standby_names = 'pgstandby_synch1'

Best Answer

replica is the default value for wal_level.

“Default” means the value that is used if the configuration files fail to provide a setting for the parameter. It is a value that is hard coded into the postgres executable.

postgresql.conf contains most parameters “commented out” and with their default values. This may be confusing at first, but documents both the parameters and their default values.