pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Convert range_in and multirange_in to report errors softly.
Date: Thu, 15 Dec 2022 17:18:45 +0000
Message-ID: <E1p5rsa-003k4H-FS@gemulon.postgresql.org> (raw)

Convert range_in and multirange_in to report errors softly.

This is mostly straightforward, except that if the range type
has a canonical function, that might throw an error during range
input.  (Such errors probably only occur for edge cases: in the
in-core canonical functions, it happens only if a bound has the
maximum valid value for the underlying type.)  Hence, this patch
extends the soft-error regime to allow canonical functions to
return errors softly as well.  Extensions implementing range
canonical functions will need modification anyway because of the
API change for range_serialize(); while at it, they might want
to do something similar to what's been done here in the in-core
canonical functions.

Discussion: https://postgr.es/m/3284599.1671075185@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d35a1af468162f510b6139bf81a7a41fd8ba8500

Modified Files
--------------
src/backend/utils/adt/multirangetypes.c          |  29 ++--
src/backend/utils/adt/multirangetypes_selfuncs.c |   3 +-
src/backend/utils/adt/rangetypes.c               | 190 +++++++++++++++++------
src/backend/utils/adt/rangetypes_gist.c          |   2 +-
src/backend/utils/adt/rangetypes_selfuncs.c      |   2 +-
src/backend/utils/adt/rangetypes_spgist.c        |   2 +-
src/backend/utils/adt/rangetypes_typanalyze.c    |   3 +-
src/include/utils/rangetypes.h                   |   6 +-
src/test/regress/expected/multirangetypes.out    |  31 ++++
src/test/regress/expected/rangetypes.out         |  67 ++++++++
src/test/regress/sql/multirangetypes.sql         |   7 +
src/test/regress/sql/rangetypes.sql              |  13 ++
12 files changed, 289 insertions(+), 66 deletions(-)



Message-ID: <E1p5rsa-003k4H-FS@gemulon.postgresql.org>
Permalink:  ../E1p5rsa-003k4H-FS@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1p5rsa-003k4H-FS@gemulon.postgresql.org

 · 

reply

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Convert range_in and multirange_in to report errors softly.
  In-Reply-To: <E1p5rsa-003k4H-FS@gemulon.postgresql.org>
  References: <E1p5rsa-003k4H-FS@gemulon.postgresql.org>

* 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