Re: Use correct collation in pg_trgm - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Use correct collation in pg_trgm
Date
Msg-id 677b2db1582d9eb9e099ea83856e610a5072dcd3.camel@j-davis.com
Whole thread Raw
In response to Re: Use correct collation in pg_trgm  (David Geier <geidav.pg@gmail.com>)
Responses Re: Use correct collation in pg_trgm
List pgsql-hackers
On Thu, 2026-03-26 at 09:50 +0100, David Geier wrote:
> I agree. That is inconsistent. But if anything, shouldn't we change
> tsvector/tsquery to as well adhere to the inferred collation?

I am not sure either way.

It's easy to specify a COLLATE clause to affect the interpretation of
the input. But once you parse the inputs into a stored value, you can't
later reinterpret those values by specifying a COLLATE clause. The
parsing already happened and the original input string was lost.

You can end up with a table full of values, some of which were parsed
with one set of semantics, and others parsed with a different set of
semantics. That may make sense or it may just cause confusion. It's
tough for me to say.

Another consequence is that if we actually declare a type to be
collatable, then parsing will infer the collation all the way through.
Is that what we want?

In any case, I think we should make an explicit decision about which
way to go before making changes. Including Peter, who probably has an
opinion here.

Regards,
    Jeff Davis




pgsql-hackers by date:

Previous
From: Jim Jones
Date:
Subject: Re: COMMENTS are not being copied in CREATE TABLE LIKE
Next
From: Tom Lane
Date:
Subject: Re: DOCS - Add introductory paragraph to Getting Started chapter