Enhancement Idea - Expose the active value of a parameter in pg_settings

From: Greg Clough <greg(dot)clough(at)ipreo(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Enhancement Idea - Expose the active value of a parameter in pg_settings
Date: 2018-05-25 13:32:37
Message-ID: MWHPR03MB313377500282EB97ADACDA4FF7690@MWHPR03MB3133.namprd03.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

I would like to propose that we expose the "active" value of parameters in pg_settings, instead of "-1". In this example below, when it's set to "-1" I need to know that autovacuum_work_mem is related to the setting of maintenance_work_mem, so that I can determine that the actual setting is 64MB:

postgresql.conf
===============
#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
#maintenance_work_mem = 64MB # min 1MB

pg_settings
===========
postgres=# SELECT name, setting, unit FROM pg_settings WHERE name IN ('autovacuum_work_mem','maintenance_work_mem');
name | setting | unit
----------------------+---------+------
autovacuum_work_mem | -1 | kB
maintenance_work_mem | 65536 | kB
(2 rows)

I think it would make sense to create a new column called something like "active_setting", which will allow simple verification of the setting that's in use without having to know the specifics about the parameter's relationship with others, and the version of PostgreSQL. For parameters where "-1" is a real setting that has meaning (e.g. log_min_duration_statement), then it should return "-1".

I presume that as a part of running the server that we have already decoded what the active values should be, so I'm asking if we can expose this data via the pg_settings view?

Regards
Greg Clough

https://ipreo.com

********* Confidential Disclaimer *********

This e-mail message and any attachments are confidential. Dissemination, distribution or copying of this e-mail or any attachments by anyone other than the intended recipient is prohibited. If you are not the intended recipient, please notify Ipreo immediately by replying to this e-mail, and destroy all copies of this e-mail and any attachments. If you have received this e-mail as part of a marketing communication and you would like to unsubscribe from future marketing communications, please review our privacy policy<http://info.ipreo.com/Ipreo-Private-Policy.html> for more information.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-05-25 13:58:48 Re: Enhancement Idea - Expose the active value of a parameter in pg_settings
Previous Message Simon Riggs 2018-05-25 13:03:38 Re: pg_replication_slot_advance to return NULL instead of 0/0 if slot not advanced