Protected custom configuration option - Mailing list pgsql-admin

From Kouber Saparev
Subject Protected custom configuration option
Date
Msg-id CAN4RuQtYoZPceeD78PrDdfVDCgU2yKi9kny01obcEStMFZPtYQ@mail.gmail.com
Whole thread Raw
List 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


pgsql-admin by date:

Previous
From: Mariel Cherkassky
Date:
Subject: Re: invalid value for parameter "client_encoding": "ISO_8859_8"
Next
From: Peter Eisentraut
Date:
Subject: Re: plpython3u and virtualenv