Re: [PG19] eager aggregation gives wrong results because of bpchar_ops

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Guofenglinux <guofenglinux(at)gmail(dot)com>, pg(at)bowt(dot)ie
Subject: Re: [PG19] eager aggregation gives wrong results because of bpchar_ops
Date: 2026-10-06 02:29:52
Message-ID: 1356708.1791253792@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

shihao zhong <zhong950419(at)gmail(dot)com> writes:
> I used Opus to go over the new features in PG19, and it found wrong
> results from eager aggregation on a bpchar column with no length.
> ...
> bpchar equality ignores trailing spaces, but bpchar_ops and
> bpchar_pattern_ops have an equalimage function, and eager aggregation
> trusts it. nbtree deduplication does too, also on 18.

Yeah, this was also complained of just a little bit ago:

https://www.postgresql.org/message-id/19749-d46adf7c7d910b07%40postgresql.org

I can see no excuse for pretending bpchar comparison is bitwise.

> The patches follow the interval_ops fix [2]. 0001 drops support
> function 4 from both opclasses, catversion bump needed.

I'm inclined to use the newer patch in v19, rather than trusting
the runtime return-false method.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-10-06 02:36:15 Re: [PG19] eager aggregation gives wrong results because of bpchar_ops
Previous Message shihao zhong 2026-10-06 02:19:01 [PG19] eager aggregation gives wrong results because of bpchar_ops