Why don't custom GUCs show in pg_settings?
| От | David G. Johnston | 
|---|---|
| Тема | Why don't custom GUCs show in pg_settings? | 
| Дата | |
| Msg-id | CAKFQuwZz08Qh2O9_pzbGDsrczwn8Vpz_MK_Zd_-HZRFi7ZO0NA@mail.gmail.com обсуждение исходный текст | 
| Ответы | Re: Why don't custom GUCs show in pg_settings? | 
| Список | pgsql-general | 
Version - 9.5
O/S - not applicable
SELECT set_config('davidj.testvar', 'value');
SELECT current_setting('davidj.testvar') --value
SELECT * FROM pg_settings WHERE name ~ 'testvar'  --or ~davidj... either way nothing shows
and:
SELECT current_setting('davidj.testvar2') -- unrecognized configuration parameter
The underlying goal is to use the custom GUC within a CREATE VIEW in a where clause.  If the user issues a valid set_config for the GUC the query is appropriately filtered otherwise I set things up so that particular clause will not apply.
I've seen and can work with various work-arounds but it seems odd that pg_settings doesn't show these custom GUCs.
Is there a simple way to read the value without receiving an error if the value is missing?
David J.
В списке pgsql-general по дате отправления: