From: Ruslan Talpa <ruslan.talpa@subzero.cloud>
To: pgsql-bugs@lists.postgresql.org
Subject: set_config with is_local parameter true escapes transaction boundaries
Date: Tue, 10 Jan 2023 10:20:08 +0200
Message-ID: <997A11B3-BC14-44FB-A505-BE7C49BE5330@subzero.cloud> (raw)
When executing set_config with the parameter ‘is_local’ set to true within a transaction, it is expected that the config value is not available after the transaction however once the config is set in any transaction, current_setting will return 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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: ruslan.talpa@subzero.cloud
Subject: Re: set_config with is_local parameter true escapes transaction boundaries
In-Reply-To: <997A11B3-BC14-44FB-A505-BE7C49BE5330@subzero.cloud>
References: <997A11B3-BC14-44FB-A505-BE7C49BE5330@subzero.cloud>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox