How to get list of customized options in postgres

In postgres I can define custom option using

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>set x.x = 12;
</code>
<code>set x.x = 12; </code>
set x.x = 12;

I can also read it using following query

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>SHOW x.x;
</code>
<code>SHOW x.x; </code>
SHOW x.x;

But I couldn’t find any command to list all such defined options. Is there anything I can use to get a list of custom defined options?

There is not any possibility to show list of custom configuration options.

You’d have to plan that ahead of time. If you list the x.x setting in postgresql.conf, it’ll show up in pg_settings system view where you could then check if its current value is different from its reset/reboot value:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>select name,setting,boot_val,reset_val
from pg_settings
where setting is distinct from boot_val
and setting is distinct from reset_val;
</code>
<code>select name,setting,boot_val,reset_val from pg_settings where setting is distinct from boot_val and setting is distinct from reset_val; </code>
select name,setting,boot_val,reset_val 
from pg_settings
where setting is distinct from boot_val
  and setting is distinct from reset_val;

But if you only run set x.x=12; without having it in there beforehand, it won’t show in that view.

Or, as suggested by @Luuk, you could set up your own duplicate set of tables that are meant to store your own settings, then

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>select set_config(name,default_setting)
from your_settings
where owner=current_user;
</code>
<code>select set_config(name,default_setting) from your_settings where owner=current_user; </code>
select set_config(name,default_setting) 
from your_settings 
where owner=current_user;

At the start of each session to load the profile. Afterwards, to check which ones have been modified:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>select current_setting(name,true)
from your_settings
where owner=current_user
and current_setting(name,true) is distinct from default_setting;
</code>
<code>select current_setting(name,true) from your_settings where owner=current_user and current_setting(name,true) is distinct from default_setting; </code>
select current_setting(name,true) 
from your_settings 
where owner=current_user
and current_setting(name,true) is distinct from default_setting;

Thing is, that’s duplicating/emulating a set of features that are already built-in.

It’s called SQL:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>postgres=# CREATE TEMP TABLE x(x INT);
CREATE TABLE
postgres=# insert into x values(12);
INSERT 0 1
postgres=# select * from x;
x
----
12
(1 row)
</code>
<code>postgres=# CREATE TEMP TABLE x(x INT); CREATE TABLE postgres=# insert into x values(12); INSERT 0 1 postgres=# select * from x; x ---- 12 (1 row) </code>
postgres=# CREATE TEMP TABLE x(x INT);
CREATE TABLE
postgres=# insert into x values(12);
INSERT 0 1
postgres=# select * from x;
 x
----
 12
(1 row)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật