pgsql: Drop the per-entry copy of the flag mode in CompoundAffixFlags.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Drop the per-entry copy of the flag mode in CompoundAffixFlags.
Date: 2026-08-30 00:12:07
Message-ID: E1x0T9a-00000002gxU-0jqm@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)hack(at)gmail(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2026-08-30 14:13:48 pgsql: doc: Mark up "option" in the CHECKPOINT synopsis.
Previous Message Nathan Bossart 2026-08-29 15:25:07 pgsql: Disallow ONLY in REPACK commands.