Re: simply custom variables protection

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: simply custom variables protection
Дата
Msg-id 10506.1175967510@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: simply custom variables protection  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: simply custom variables protection  ("Pavel Stehule" <pavel.stehule@hotmail.com>)
Список pgsql-patches
Bruce Momjian <bruce@momjian.us> 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:
http://archives.postgresql.org/pgsql-hackers/2006-11/msg00911.php

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

В списке pgsql-patches по дате отправления:

Предыдущее
От: "Pavan Deolasee"
Дата:
Сообщение: Re: [HACKERS] Optimized pgbench for 8.3
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: simply custom variables protection