PostgreSQL

List Settings In postgresql.conf and postgresql.auto.conf

MySQL INSERT IGNORE PostgreSQL

There are places in PostgreSQL that we can still see the old and new values at the same time. One of them pg_settings table. This post shows how to list all the settings from postgresql.conf and those that postgresql.auto.conf overrode. Note that we tested this post with PostgreSQL 10.5.

PostgreSQL Configration from postgresql.conf and postgresql.auto.conf

When PostgreSQL starts up for the first time, it loads configuration from a number of files. Two of them are postgresql.conf and postgresql.auto.conf.

SQL Statements Used

List settings defined in postgresql.conf and overridden by postgresql.auto.conf

Alter settings

If context equal to postmaster, changing this parameter requires a restart of the PostgreSQL service. If it’s equal to user, changes just require a reload to take effect globally.

Note that restarting PostgreSQL terminates active connections.

Reloading after settings change

When we check the settings again, we will have:

You Might Also Like