From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve behavior of tsearch_readline(), and remove t_readline().
Date: Thu, 24 Sep 2020 00:27:04 +0000
Message-ID: <E1kLF6G-0003RZ-96@gemulon.postgresql.org> (raw)
Improve behavior of tsearch_readline(), and remove t_readline().
Commit fbeb9da22, which added the tsearch_readline APIs, left
t_readline() in place as a compatibility measure. But that function
has been unused and deprecated for twelve years now, so that seems
like enough time to remove it. Doing so, and merging t_readline's
code into tsearch_readline, aids in making several useful
improvements:
* The hard-wired 4K limit on line length in tsearch data files is
removed, by using a StringInfo buffer instead of a fixed-size buffer.
* We can buy back the per-line palloc/pfree added by 3ea7e9550
in the common case where encoding conversion is not required.
* We no longer need a separate pg_verify_mbstr call, as that
functionality was folded into encoding conversion some time ago.
(We could have done some of this stuff while keeping t_readline as a
separate API, but there seems little point, since there's no reason
for anyone to still be using t_readline directly.)
Discussion: https://postgr.es/m/48A4FA71-524E-41B9-953A-FD04EF36E2E7@yesql.se
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/83b61319a16ceabc7ea7d1143dcc045826c112d2
Modified Files
--------------
src/backend/tsearch/dict_thesaurus.c | 5 ---
src/backend/tsearch/ts_locale.c | 78 +++++++++++++-----------------------
src/include/tsearch/ts_locale.h | 7 ++--
3 files changed, 32 insertions(+), 58 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: Improve behavior of tsearch_readline(), and remove t_readline().
In-Reply-To: <E1kLF6G-0003RZ-96@gemulon.postgresql.org>
References: <E1kLF6G-0003RZ-96@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