SHOW displays the current value of a PostgreSQL setting, such as the time zone or the server’s version. Type SHOW and the setting’s name in psql. Here’s how, with three settings as the example.
Every command and output on this page is real, from PostgreSQL 19 on macOS.
Syntax
SHOW setting_name;
SHOW ALL;
setting_name: the setting to show, such asTimeZone. Setting names don’t care about upper and lower case.SHOW ALL: shows every setting, with a short description of each.
See SHOW (opens in a new tab) in the PostgreSQL documentation.
The Example
No database or table needed: you ask the server about three of its settings.
Step 1: Connect
Open Terminal and connect to your PostgreSQL server with psql as the postgres user:
psql -U postgres
Type the user’s password when psql asks for it. psql connects you to the postgres database, and its prompt is postgres=#.
Step 2: Show the Time Zone
SHOW TimeZone;
TimeZone
--------------
Asia/Kolkata
(1 row)
This server works in India’s time zone. Yours shows its own.
Step 3: Show Two More Settings
SHOW work_mem;
work_mem
----------
4MB
(1 row)
work_mem is the memory one sort or hash may use before it writes to temporary files on disk. 4MB is the default.
SHOW server_version;
server_version
----------------
19.0
(1 row)
server_version is the version of PostgreSQL the server runs.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| A misspelled setting name | ERROR: unrecognized configuration parameter "timezon" | Check the spelling. SHOW ALL lists every setting’s name. |
FAQ
How do I change a setting?
SET changes many settings for your current session. SHOW only reads them.
Conclusion
SHOW and a setting’s name display its current value, and SHOW ALL lists them all.
Additional Resources
- PostgreSQL 19 documentation: SHOW (opens in a new tab)
- PostgreSQL 19 documentation: Setting Parameters (opens in a new tab)
Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada, and used with their permission.
0 comments