Re: Improve documentation regarding custom settings, placeholders, and the administrative functions

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Improve documentation regarding custom settings, placeholders, and the administrative functions
Date: 2025-02-06 02:49:10
Message-ID: CAKFQuwYaWWiK_u6fuKgUi+aDUvhTurNKwvG_VWQ5Sp_2HnGh3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 5, 2025 at 7:36 PM Zhang Mingli <zmlpostgres(at)gmail(dot)com> wrote:

> On Oct 20, 2024 at 04:12 +0800, David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com>, wrote:
>
>
> Mostly I'm pointing out the fact that one can never take the null value to
> be the actual value of a setting. In terms of current_setting this then
> establishes the fact that the null value it may return is an error-handling
> alternative only and not something to be relied upon as being an actual
> value of the setting.
>
>
> - Returns the current value of the+ Returns the current
> non-null value of the setting
> <parameter>setting_name</parameter>. If there is no such
> setting, <function>current_setting</function> throws an error
> unless <parameter>missing_ok</parameter> is supplied and
>
>
> Hi,
>
> current_setting() could return NULL when missing_ok is passed, so is it
> right to say: Returns the current non-null value of the setting
> <parameter>setting_name</parameter>?
> As the doc is for function of current_setting(), and it could return NULL
> actually.
>

Yes, and when it does it is doing so in lieu of an error, and thus it is
not returning the value of the setting. It does not mean the value taken
on by the named parameter is NULL, which is not possible. i.e., SHOW will
never produce NULL.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-02-06 02:52:14 Re: Show WAL write and fsync stats in pg_stat_io
Previous Message Zhang Mingli 2025-02-06 02:36:20 Re: Improve documentation regarding custom settings, placeholders, and the administrative functions