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-16 19:20:54
Message-ID: CAN4CZFMpFBH21D6q+eNeN4kD8wBv71r27JqyHJuBzCCwH_R9nw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

show_trgm is still affected with the same issue:

CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE TEMP TABLE st_a(x text COLLATE "C"); INSERT INTO st_a
VALUES ('hello');
CREATE TEMP TABLE st_b(y text COLLATE "POSIX"); INSERT INTO st_b
VALUES ('world');
SELECT show_trgm(x || y) FROM st_a, st_b;

And I noticed one more thing, is this change expected, as it doesn't
seem intentional? (also with posix or ucs_basic)

SELECT show_trgm('Привет мир' COLLATE "C");
-- {}

postgres=# SELECT similarity('Привет мир' COLLATE "C", 'Привет мир'
COLLATE "C");
-- 0

Looking back this is caused by 0002, and was there since v2 and I
completely missed it before.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Lamberson 2026-11-16 19:36:00 Re: Extensible sync handler registration (register_sync_handler)
Previous Message Stepan Neretin 2026-11-16 19:13:25 Assert "target_wal_endrec == divergerec" in pg_rewind