Hello
Documentation has no description how 'false' value for 'is_local' parameter interact with transaction
Do I understand correct?
https://www.postgresql.org/docs/11/functions-admin.html#FUNCTIONS-ADMIN-SET
>set_config sets the parameter setting_name to new_value. If is_local is true, the new value will only apply to the
currenttransaction. If you want the new value to apply for the current session, use false instead.
If I use 'false' then transaction will not have effect, because I set the value to session?
tucha=> select current_setting( 'my.app_period', true );
current_setting
-----------------
(1 row)
tucha=> begin;
BEGIN
tucha=> select set_config( 'my.app_period', tstzrange( '-infinity', 'infinity' )::text, false );
set_config
----------------------
[-infinity,infinity)
(1 row)
tucha=> rollback;
ROLLBACK
NOTICE: session is rolled back and session value is rolled back despite on that I did not use 'true' as parameter for
local:
tucha=> select current_setting( 'my.app_period', true );
current_setting
-----------------
(1 row)
tucha=> begin;
BEGIN
tucha=> select set_config( 'my.app_period', tstzrange( '-infinity', 'infinity' )::text, false );
set_config
----------------------
[-infinity,infinity)
(1 row)
tucha=> commit;
COMMIT
When I commit then the value is applied to session:
tucha=> select current_setting( 'my.app_period', true );
current_setting
----------------------
[-infinity,infinity)
(1 row)
--
Best regards,
Eugen Konkov