From: Bruce Momjian <bruce@momjian.us>
To: kes-kes@yandex.ru
To: pgsql-docs@lists.postgresql.org
Subject: Re: Improve documentation for current_setting function
Date: Thu, 21 Feb 2019 20:39:24 -0500
Message-ID: <20190222013924.2s77vm2cux3r54y2@momjian.us> (raw)
In-Reply-To: <155066758528.1380.15762542539181651429@wrigleys.postgresql.org>
References: <155066758528.1380.15762542539181651429@wrigleys.postgresql.org>
On Wed, Feb 20, 2019 at 12:59:45PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/11/functions-admin.html
> Description:
>
> Hi.
>
> Doc is not clear about what is returned if current_setting(
> 'app.not_existent', true ) is called.
>
> Does it return empty string '', because return type is 'text' or it return
> NULL, because 'app.not_existent' does not exist
Testing shows:
SELECT current_setting('asdf', true);
current_setting
-----------------
\pset null (null)
SELECT current_setting('asdf', true);
current_setting
-----------------
--> (null)
How do you like the attached patch, which clarifies this?
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
Attachments:current_setting.diff (text/x-diff, 823B) downloaddiff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgmlnew file mode 100644index 86ff4e5..f638c6d
*** a/doc/src/sgml/func.sgml
--- b/doc/src/sgml/func.sgml
*************** SELECT current_setting('datestyle');
*** 18722,18728 ****
If there is no setting named <parameter>setting_name</parameter>,
<function>current_setting</function> throws an error
unless <parameter>missing_ok</parameter> is supplied and is
! <literal>true</literal>.
</para>
<para>
--- 18722,18729 ----
If there is no setting named <parameter>setting_name</parameter>,
<function>current_setting</function> throws an error
unless <parameter>missing_ok</parameter> is supplied and is
! <literal>true</literal>, in which case a missing parameter returns
! NULL.
</para>
<para>
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: bruce@momjian.us, kes-kes@yandex.ru, pgsql-docs@lists.postgresql.org
Subject: Re: Improve documentation for current_setting function
In-Reply-To: <20190222013924.2s77vm2cux3r54y2@momjian.us>
* 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