From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: kes-kes@yandex.ru
Subject: Unexpected behaviour: it was documented to return the same value
Date: Sat, 05 Jul 2025 23:20:27 +0000
Message-ID: <175175762761.3157502.18041595164515835428@wrigleys.postgresql.org> (raw)
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/17/functions-admin.html
Description:
set_config ( setting_name text, new_value text, is_local boolean ) → text
Sets the parameter setting_name to new_value, and returns that value. If
is_local is true, the new value will only apply during the current
transaction. If you want the new value to apply for the rest of the current
session, use false instead. This function corresponds to the SQL command
SET.
set_config('log_statement_stats', 'off', false) → off
```
invoice=> select set_config( 'app.asdf', null, false ) is null;
?column?
----------
f
(1 row)
invoice=> select set_config( 'app.asdf', null, false ) = '';
?column?
----------
t
(1 row)
```
Expected: because I provided NULL value I expect to receive NULL as result
Actual: but function returns the empty string instead.
It would be better to follow documented behaviour, if it will not be
possible to fix it, please at least document that.
Thank you.
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 using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, kes-kes@yandex.ru
Subject: Re: Unexpected behaviour: it was documented to return the same value
In-Reply-To: <175175762761.3157502.18041595164515835428@wrigleys.postgresql.org>
* 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