On Tue Sep 1, 2026 at 11:01 AM -03, Jan Nidzwetzki wrote: > I think I found a problem in patch 4. group_by_has_partkey() has no > opfamily check, so stripping the RelabelType from the partition key side > means the grouping uses the argument type's equality. In contrast, the > partitioning uses the result type's.
You're right, and thanks for catching it. My reasoning when I wrote that patch was that the collation was still validated separately, which is true but beside the point: collation is only one dimension of equality semantics, and the type's operator family is the other. Before the strip, requiring the two expressions to be structurally equal implicitly guaranteed they had the same type and therefore the same equality semantics. Stripping the RelabelType removed that guarantee without replacing it. > In patch 4, I added an op_in_opfamily() check in group_by_has_partkey(). > [...] > What do you think? > I think it's right, the citext case now plans as partial aggregation and returns the correct single group. So v8 looks good to me. -- Matheus Alcantara EDB: https://www.enterprisedb.com
