Bug in Configuration Setting Functions after a Commit - Mailing list pgsql-bugs

From João felipe Chiarelli Bourscheid
Subject Bug in Configuration Setting Functions after a Commit
Date
Msg-id CAKJNEk=CJsz_W17i-1PL_PH1igteFhJT_L6_7jvLfg5TT8D6ow@mail.gmail.com
Whole thread Raw
Responses Re: Bug in Configuration Setting Functions after a Commit
List 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


pgsql-bugs by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: BUG #18822: mailing lists reject mails due to DKIM-signature
Next
From: "David G. Johnston"
Date:
Subject: Re: Bug in Configuration Setting Functions after a Commit