set_config() documentation clarification

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема set_config() documentation clarification
Дата
Msg-id ee989979-6e04-4811-a7ac-071f69b3f689@www.fastmail.com
обсуждение исходный текст
Ответы Re: set_config() documentation clarification  (Chapman Flack <chap@anastigmatix.net>)
Re: set_config() documentation clarification  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
I just learned from a pg friend, it's possible to set your own made up setting_name using set_config(),
if the setting_name contains at least one dot ".".

I didn't know about this and have always thought it's not possible,
due to early in my career having run into the error message
you get when not having a dot in the name:

SELECT set_config('foobar','test',true);
ERROR:  unrecognized configuration parameter "foobar"

If instead having a dot in the name, it works:

SELECT set_config('foo.bar','test',true);
set_config
------------
test
(1 row)


this behaviour is not mentioned anywhere as far as I can see:

"set_config ( setting_name text, new_value text, is_local boolean ) → text

Sets the parameter setting_name to new_value, and returns that value. If is_local is true, the new value will only apply for the current transaction. If you want the new value to apply for the current session, use false instead. This function corresponds to the SQL command SET."

Perhaps a paragraph where this is clarified should be added?

Kind regards,

Joel

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Safety/validity of resetting permissions by updating system tables
Следующее
От: Dean Rasheed
Дата:
Сообщение: Re: PoC/WIP: Extended statistics on expressions