ufuk@paralaus.com writes:
> Given a database with encoding UTF-8, locale tr_TR.UTF-8, 'pg_trgm'
> extension enabled, and the following setup:
> CREATE TABLE car_makers (maker TEXT);
> INSERT INTO car_makers VALUES ('AUDI'), ('MINI');
> Run any one of the following commands:
> - SELECT maker <-> 'MAZDA' FROM car_makers;
> - SELECT similarity(maker, 'MAZDA') FROM car_makers;
> - SELECT show_trgm('III');
> As a result, it seems there is a problem with trigrams generation and/or
> comparison when the Turkish locale is being used.
It looks like generate_trgm() is not considering the possibility that
case-folding will make the string physically longer, so you get a buffer
overrun when any of these I-containing strings are converted to trigrams.
Will fix, thanks for the report!
regards, tom lane