Bruce Momjian <[EMAIL PROTECTED]> writes:
> Pavel Stehule wrote:
>> My patch allows to allert somebody so any custom variable is protected.
> How does a user protect a custom variable using your code? I don't see
> any API that would allow that.
The call would have to come from the loadable library that defines the
custom variable. However, the complaint I had was that we already have
an API that should be able to do this, namely setting a protection level
higher than PGC_USERSET in the DefineCustomVariable call. That doesn't
work today, but the right answer is to make it work, not invent more
functions. This was agreed to be the right approach some time ago,
see thread here:
Pavel's proposed patch complicates the API and the code, and offers only
part of the same functionality, ie, the equivalent of PGC_SUSET; but
I think that for example PGC_SIGHUP is a perfectly reasonable setting
to want to use with a custom variable.
Furthermore I believe the patch is incomplete/wrong, because it adds
only one check on the "armored" flag, whereas PGC_SUSET affects behavior
in a number of places. I also notice that it will make setting of a
an armored custom variable from postgresql.conf fail outright in
non-superuser sessions, which is surely not desirable.
In short: this isn't a feature, it's a wart.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend