From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Drop the per-entry copy of the flag mode in CompoundAffixFlags.
Date: Sun, 30 Aug 2026 00:12:07 +0000
Message-ID: <E1x0T9a-00000002gxU-0jqm@gemulon.postgresql.org> (raw)
Drop the per-entry copy of the flag mode in CompoundAffixFlags.
Each CompoundAffixFlag carried its own copy of the dictionary's flag
mode, which decides whether the union holds a string or an integer.
The comment on the field explained why: cmpcmdflag() needs the mode,
and at the time there was no bsearch() variant that would allow
passing that context through. But that problem is long gone, so let's
remove the redundant storage. No flexibility is lost because things
would not work anyway if different flags within a dictionary have
different representations; and the preceding commit has seen to it
that they can't. At present, this saves no storage on 64-bit machines
because of alignment issues, but it still seems like good
simplification.
No back-patch: there's little value in this except cleanliness, and
although probably no outside code is looking at this data structure,
this'd be an API/ABI break if any does.
Author: Ewan Young <kdbase.hack@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAON2xHN3QmsaySM6DGWa1gttcbJoFh0wjAE-_ZpSPo=LKN1hYw@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/2fb8da5a245661287833b05a1b2e275ddf83bbd7
Modified Files
--------------
src/backend/tsearch/spell.c | 22 +++++++++-------------
src/include/tsearch/dicts/spell.h | 6 ++----
2 files changed, 11 insertions(+), 17 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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Drop the per-entry copy of the flag mode in CompoundAffixFlags.
In-Reply-To: <E1x0T9a-00000002gxU-0jqm@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