set_config with is_local parameter true escapes transaction boundaries
| От | Ruslan Talpa |
|---|---|
| Тема | set_config with is_local parameter true escapes transaction boundaries |
| Дата | |
| Msg-id | 997A11B3-BC14-44FB-A505-BE7C49BE5330@subzero.cloud обсуждение исходный текст |
| Ответы |
Re: set_config with is_local parameter true escapes transaction boundaries
|
| Список | pgsql-bugs |
When executing set_config with the parameter ‘is_local’ set to true within a transaction, it is expected that the
configvalue is not available after the transaction however once the config is set in any transaction, current_setting
willreturn an empty string instead of null
If this is expected behaviour, it is not mentioned anywhere in the documentation.
Steps to reproduce / example
psql (13.9, server 15.1 (Debian 15.1-1.pgdg110+1))
WARNING: psql major version 13, server major version 15.
Some psql features might not work.
Type "help" for help.
app=# select current_setting('custom.a', true), current_setting('custom.a', true) is null;
current_setting | ?column?
-----------------+----------
| t
(1 row)
app=# BEGIN;
START TRANSACTION
app=*# select set_config('custom.a', 'vv', true);
set_config
------------
vv
(1 row)
app=*# COMMIT;
COMMIT
app=# select current_setting('custom.a', true), current_setting('custom.a', true) is null;
current_setting | ?column?
-----------------+----------
| f
(1 row)
В списке pgsql-bugs по дате отправления: