From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: multirange constructor strictness
Date: Wed, 21 Apr 2021 22:56:54 +0200
Message-ID: <0f783a96-8d67-9e71-996b-f34a7352eeef@enterprisedb.com> (raw)
The multirange constructors created in makeMultirangeConstructors() are:
multirange_constructor0 -> not strict
multirange_constructor1 -> strict
multirange_constructor2 -> not strict
And both multirange_constructor1 and multirange_constructor2 contain
code like
/*
* These checks should be guaranteed by our signature, but let's do them
* just in case.
*/
if (PG_ARGISNULL(0))
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
errmsg("multirange values cannot contain NULL members")));
In case of multirange_constructor2 the "should be guaranteed" comment is
not actually true right now. In case of multirange_constructor1, maybe
this should be downgraded to an elog or assert or just removed.
Is there a reason why we can't make them all three strict or all not
strict? (Obviously, it doesn't matter for multirange_constructor0.) Is
the fact that multirange_constructor2 is variadic the issue? Maybe at
least some more comments would be helpful.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@enterprisedb.com
Subject: Re: multirange constructor strictness
In-Reply-To: <0f783a96-8d67-9e71-996b-f34a7352eeef@enterprisedb.com>
References: <0f783a96-8d67-9e71-996b-f34a7352eeef@enterprisedb.com>
* 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