Re: [PATCH] Avoid collation lookup for "char" statistics

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Feng Wu <wufengwufengwufeng@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-06-27T02:44:07Z
Lists: pgsql-hackers
Feng Wu <wufengwufengwufeng@gmail.com> writes:
> The internal "char" type is not collatable, and its btree operators
> order the byte value directly.  Return the one-byte string for CHAROID
> without consulting collation state, avoiding a lookup of InvalidOid as
> collation 0.

Can you demonstrate that there is a problem worth worrying about here?
We've had no field reports of failures in this code, and I don't see
a problem with, e.g.

 explain select * from pg_type a join pg_type b using (typtype);

			regards, tom lane



Commits

  1. Avoid collation lookup failure when considering a "char" column.

  2. Remove lc_collate_is_c().