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)