Protected custom configuration option

From: Kouber Saparev <kouber(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Protected custom configuration option
Date: 2018-07-25 11:41:47
Message-ID: CAN4RuQtYoZPceeD78PrDdfVDCgU2yKi9kny01obcEStMFZPtYQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,

I am looking for a way to define custom configuration option that will
only be accessible to roles with the "pg_read_all_settings" privilege.

I see such variables defined with the GUC_SUPERUSER_ONLY flag within
src/backend/utils/misc/guc.c:

{"ssl_ecdh_curve", PGC_SIGHUP, CONN_AUTH_SSL,
gettext_noop("Sets the curve to use for ECDH."),
NULL,
GUC_SUPERUSER_ONLY
},
&SSLECDHCurve,

Is it possible to have a custom setting defined with this flag and
how? Only through an extension written in C, maybe?

What I need is something like:

kouber=> show redis.pass;
ERROR: must be superuser or a member of pg_read_all_settings to
examine "redis.pass"

Cheers,
--
Kouber

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Eisentraut 2018-07-25 13:10:25 Re: plpython3u and virtualenv
Previous Message Mariel Cherkassky 2018-07-25 07:22:08 Re: invalid value for parameter "client_encoding": "ISO_8859_8"