Show a PostgreSQL setting in psql shell
When you for example set shared_buffers=1GB
in your postgresql.conf file and then want to verify this setting in a query, or the psql shell, it gets a bit confusing.
postgres=# select name,setting,unit from pg_settings where name='shared_buffers';
name | setting | unit
----------------+---------+------
shared_buffers | 131072 | 8kB
(1 row)
There are two ways to view the correct value.
postgres=# select name, current_setting(name) from pg_settings where name='shared_buffers';
name | current_setting
----------------+-----------------
shared_buffers | 1GB
(1 row)
postgres=# SHOW shared_buffers;
shared_buffers
----------------
1GB
(1 row)