From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Convert tsqueryin and tsvectorin to report errors softly.
Date: Tue, 27 Dec 2022 17:00:49 +0000
Message-ID: <E1pADJo-000gnc-Oy@gemulon.postgresql.org> (raw)
Convert tsqueryin and tsvectorin to report errors softly.
This is slightly tedious because the adjustments cascade through
a couple of levels of subroutines, but it's not very hard.
I chose to avoid changing function signatures more than absolutely
necessary, by passing the escontext pointer in existing structs
where possible.
tsquery's nuisance NOTICEs about empty queries are suppressed in
soft-error mode, since they're not errors and we surely don't want
them to be shown to the user anyway. Maybe that whole behavior
should be reconsidered.
Discussion: https://postgr.es/m/3824377.1672076822@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/78212f21011449f0374831323655baa7c00f3680
Modified Files
--------------
src/backend/tsearch/to_tsany.c | 12 ++--
src/backend/utils/adt/tsquery.c | 100 ++++++++++++++++++++++++--------
src/backend/utils/adt/tsquery_cleanup.c | 7 ++-
src/backend/utils/adt/tsvector.c | 15 +++--
src/backend/utils/adt/tsvector_parser.c | 49 +++++++++++-----
src/include/tsearch/ts_utils.h | 10 +++-
src/test/regress/expected/tstypes.out | 44 ++++++++++++++
src/test/regress/sql/tstypes.sql | 11 ++++
8 files changed, 196 insertions(+), 52 deletions(-)
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 tsqueryin and tsvectorin to report errors softly.
In-Reply-To: <E1pADJo-000gnc-Oy@gemulon.postgresql.org>
References: <E1pADJo-000gnc-Oy@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