Bug in Configuration Setting Functions after a Commit

From: João felipe Chiarelli Bourscheid <joao(dot)felipe(dot)c(dot)b(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Bug in Configuration Setting Functions after a Commit
Date: 2025-02-24 18:26:07
Message-ID: CAKJNEk=CJsz_W17i-1PL_PH1igteFhJT_L6_7jvLfg5TT8D6ow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello:

I'm enthusiastic about the PostgreSQL project and this is my first bug
report. Please apologize if I'm on the wrong channel.

The bug is the following: when I set a custom variable using the
configuration settings functions within a transaction, after I commit the
transaction, instead of the variable becoming null, it becomes an empty
string.

How to reproduce:

SELECT current_setting('custom.user_id', true)::INTEGER; -- NULL

BEGIN;

SELECT set_config('custom.user_id', '2', true);

SELECT current_setting('custom.user_id', true)::INTEGER; -- 2

END;

SELECT current_setting('custom.user_id', true)::INTEGER; -- Empty string
instead of null

PostgreSQL version: PostgreSQL 15.10 (Debian 15.10-0+deb12u1) on
x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2025-02-24 18:38:10 Re: Bug in Configuration Setting Functions after a Commit
Previous Message Magnus Hagander 2025-02-24 16:44:07 Re: BUG #18822: mailing lists reject mails due to DKIM-signature