Re: pg_advisory_unlock(null)

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: morgothko(at)gmail(dot)com, Pg Docs <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_advisory_unlock(null)
Date: 2022-07-15 19:52:03
Message-ID: CAKFQuwaEu1BiBghCZtibXDhF8PsTrxMZ4MNMYe+zdkoWWNYcjA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Thu, Jul 14, 2022 at 6:36 AM PG Doc comments form <noreply(at)postgresql(dot)org>
wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/12/functions-admin.html
> Description:
>
> Hello!
> There is no information in documentation about pg_advisory_unlock with NULL
> value.
> This call: select pg_advisory_unlock(null), returns null without reporting,
> but according to the documentation it was expected either false or true.
> Maybe add information about null value?
> version: 12.10
>

It is defined as strict because there is nothing meaningful that could be
done with a null input. Saying that seems unnecessary; I'm sure if you
look you will find many more places where this complaint applies.

If I did anything it would be to add a comment to the Function and
Operators page that says something like:

Many of the functions listed herein cannot produce a meaningful result when
supplied with null arguments. These functions will simply produce a null
output without being invoked. These are not explicitly labelled in the
documentation, though you may inspect the system catalog to confirm whether
a given function is or is not defined as being "strict" (returns null on
null input). In most cases one should assume that unless the behavior
regarding null inputs is explained that the function in question is defined
to be strict. Operators likewise tend to produce null outputs if at least
one of their inputs are null. Aggregate and window functions are the most
common exception to this rule.

David J.

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Michael Paquier 2022-07-16 02:46:11 Re: list of flags that pg_settings_get_flags reports
Previous Message Nikhil Shetty 2022-07-15 15:57:21 Re: Fwd: Adding more detail to pg_upgrade documentation