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 a few datatype input functions to use "soft" error repor
Date: Fri, 09 Dec 2022 15:15:04 +0000
Message-ID: <E1p3f5c-002gaX-1A@gemulon.postgresql.org> (raw )
Convert a few datatype input functions to use "soft" error reporting.
This patch converts the input functions for bool, int2, int4, int8,
float4, float8, numeric, and contrib/cube to the new soft-error style.
array_in and record_in are also converted. There's lots more to do,
but this is enough to provide proof-of-concept that the soft-error
API is usable, as well as reference examples for how to convert
input functions.
This patch is mostly by me, but it owes very substantial debt to
earlier work by Nikita Glukhov, Andrew Dunstan, and Amul Sul.
Thanks to Andres Freund for review.
Discussion: https://postgr.es/m/3bbbb0df-7382-bf87-9737-340ba096e034@postgrespro.ru
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ccff2d20ed9622815df2a7deffce8a7b14830965
Modified Files
--------------
contrib/cube/cube.c | 3 +-
contrib/cube/cubedata.h | 7 +-
contrib/cube/cubeparse.y | 76 +++++++++----
contrib/cube/cubescan.l | 8 +-
contrib/cube/expected/cube.out | 25 +++++
contrib/cube/sql/cube.sql | 6 +
src/backend/utils/adt/arrayfuncs.c | 125 ++++++++++++---------
src/backend/utils/adt/arrayutils.c | 31 ++++-
src/backend/utils/adt/bool.c | 5 +-
src/backend/utils/adt/float.c | 96 ++++++----------
src/backend/utils/adt/geo_ops.c | 6 +-
src/backend/utils/adt/int.c | 4 +-
src/backend/utils/adt/int8.c | 2 +-
src/backend/utils/adt/jsonpath_exec.c | 29 ++---
src/backend/utils/adt/numeric.c | 98 ++++++++++------
src/backend/utils/adt/numutils.c | 57 +++++++---
src/backend/utils/adt/rowtypes.c | 49 ++++++--
src/include/utils/array.h | 4 +
src/include/utils/builtins.h | 3 +
src/include/utils/float.h | 6 +-
src/test/regress/expected/arrays.out | 25 +++++
src/test/regress/expected/boolean.out | 19 ++++
.../regress/expected/float4-misrounded-input.out | 25 +++++
src/test/regress/expected/float4.out | 25 +++++
src/test/regress/expected/float8.out | 25 +++++
src/test/regress/expected/int2.out | 25 +++++
src/test/regress/expected/int4.out | 25 +++++
src/test/regress/expected/int8.out | 25 +++++
src/test/regress/expected/numeric.out | 43 +++++++
src/test/regress/expected/rowtypes.out | 31 +++++
src/test/regress/sql/arrays.sql | 6 +
src/test/regress/sql/boolean.sql | 5 +
src/test/regress/sql/float4.sql | 6 +
src/test/regress/sql/float8.sql | 6 +
src/test/regress/sql/int2.sql | 6 +
src/test/regress/sql/int4.sql | 6 +
src/test/regress/sql/int8.sql | 6 +
src/test/regress/sql/numeric.sql | 9 ++
src/test/regress/sql/rowtypes.sql | 7 ++
39 files changed, 727 insertions(+), 238 deletions(-)
Message-ID: <E1p3f5c-002gaX-1A@gemulon.postgresql.org>
Permalink: ../E1p3f5c-002gaX-1A@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1p3f5c-002gaX-1A@gemulon.postgresql.org
copy link · copy postgr.es
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 a few datatype input functions to use "soft" error repor
In-Reply-To: <E1p3f5c-002gaX-1A@gemulon.postgresql.org>
References: <E1p3f5c-002gaX-1A@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