Troubleshooting·PostgreSQL
PostgreSQL Configuration Precedence
pg_settings.source names where every live value came from - default, configuration file, or a session override. It is the query that ends an argument about why a setting is what it is.
Configuration Guide 15 of 47 Advanced
- OSUbuntu 26.04 LTS
- PostgreSQL18.6-0ubuntu0.26.04.1
- TimeAbout 13 min
sourcefile and sourceline are visible only to superusers and roles granted pg_read_all_settings. As an ordinary role they come back empty, which is a restriction rather than a bug.
- PackagingDebian cluster layout
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| db-a01 | 192.168.0.81 | Ubuntu 26.04 LTS | Primary / Source / Replica Set Member 1 | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when you need to know where a live value actually came from. This matters because pg_settings.source names it - default, configuration file, or ALTER SYSTEM - so precedence is readable rather than reasoned about.
- asking where each value came from, for four settings at once
- handing a setting back to the defaults with
ALTER SYSTEM RESET - reading precedence off the server instead of inferring it
Before you start
- Settings changed by the previous guides in this track.
-
Ask where each value came from
-
Hand a setting back to the defaults