Re: Improve documentation for current_setting function - Mailing list pgsql-docs

From Eugen Konkov
Subject Re: Improve documentation for current_setting function
Date
Msg-id 925065522.20190222114354@yandex.ru
Whole thread Raw
In response to Re: Improve documentation for current_setting function  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Improve documentation for current_setting function  (Bruce Momjian <bruce@momjian.us>)
List pgsql-docs
Hello Bruce,

> How do you like the attached patch, which clarifies this?

>>in which case a missing parameter returns
>>!     NULL.

not  always. It can be NULL or empty string. It depends if the current
session is new or after finished transaction which makes 'local' changes
to setting

Take into account these steps: https://www.postgresql.org/message-id/15646-0d3caee9f6266f60%40postgresql.org

From  my  user point of view. if the boot value before transaction was
NULL then after transaction it MUST stay NULL and not empty string.

This  will  be  consistent with that if I open new parallel session it
will return NULL.

Also I see NULL value (if setting was not defined) is useful.


Also this:
set_config( 'my.name', NULL )
must  set 'my.name' to NULL or must issue warning about NULL is turned
into empty string.

Personally  I  dislike  that  NULL  is converted to empty string. This
looks ugly. =(

--
Best regards,
Eugen Konkov



pgsql-docs by date:

Previous
From: PG Doc comments form
Date:
Subject: HEADER [ boolean ] not allowed in COPY ... FROM statement
Next
From: PG Doc comments form
Date:
Subject: Postgres make uninstall