Re: Use correct collation in pg_trgm

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: David Geier <geidav(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, solai v <solai(dot)cdac(at)gmail(dot)com>
Subject: Re: Use correct collation in pg_trgm
Date: 2026-11-06 22:17:38
Message-ID: CAN4CZFN5dvVe1a5iB_jJYGazL=QzMpUmFXn6bMi2g3zmSX9PdA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

With the latest version, an XX000 cache lookup can surface to the user
with two columns with different collations:

Minimal repro:

CREATE EXTENSION IF NOT EXISTS pg_trgm;
DROP TABLE IF EXISTS ic_a, ic_b;
CREATE TABLE ic_a(x text COLLATE "C");
CREATE TABLE ic_b(y text COLLATE "POSIX");
INSERT INTO ic_a VALUES ('hello world');
INSERT INTO ic_b VALUES ('hello word');
SELECT similarity(x, y) FROM ic_a, ic_b;
-- ERROR: XX000: cache lookup failed for collation 0

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Corey Huinker 2026-11-06 22:11:07 Re: [PG19] pg_dump marks extended statistics of pre-v15 partitioned tables as non-inherited