Re: BUG #15646: Inconsistent behavior for current_setting/set_config

Поиск
Список
Период
Сортировка
От Jerry Sievert
Тема Re: BUG #15646: Inconsistent behavior for current_setting/set_config
Дата
Msg-id BFCCBA3C-9BD3-4B95-9873-15EFA4CC7E07@legitimatesounding.com
обсуждение исходный текст
Ответ на Re: BUG #15646: Inconsistent behavior for current_setting/set_config  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
Hi,

On Feb 20, 2019, at 9:32 AM, David G. Johnston <david.g.johnston@gmail.com> wrote:
  Users should be
informed that as far as the GUC system is concerned NULL and the empty
string are equivalent and that resetting uses the empty string while
never being set returns NULL.


Except that it’s not - the code path in guc.c uses what is passed as the boot value:

var->boot_val = bootValue;


It’s up to the extension developer to understand that this can be changed back to something other than the boot value and not actually be the boot value - you can see this assumption being made in plpgsql, pltcl, and plperl.  The GUC system makes no notification that the two are equivalent, neither in code nor in documentation.

Its immaterial whether its existence is due to a bug that simply
became acceptable or was an otherwise retrospectively poor design
decision - at this point we have to live with it and should treat it
as a proper and supported feature, if only in its current form.  At
least until someone feels strongly enough to deprecate it and put
something else more suitable in its place.


Agreed, but it needs to be documented, the current documentation gives only the boot value, and does not note that string variables are the only variables that behave differently and do not return to their boot value.

Вложения

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

Предыдущее
От: Andre Piwoni
Дата:
Сообщение: Re: BUG #15638: pg_basebackup with --wal-method=stream incorrectlygenerates WAL segment created during backup
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15572: Misleading message reported by "Drop function operation" on DB with functions having same name