Re: POC: contrib/unaccent as IMMUTABLE

2020-10-25 Thread Thomas Munro
On Sun, Oct 4, 2020 at 4:19 AM Tom Lane wrote: > Tomas Vondra writes: > > As for the patch, I wonder if we want to make this change. I'm not very > > familiar with how unaccent works, but if changes to unicode rules would > > really silently break indexes, it's kinda similar to the collation > >

Re: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Alexander Korotkov
On Sat, Oct 3, 2020 at 6:37 PM Tom Lane wrote: > Alexander Korotkov writes: > > I personally don't have an exact understanding of how strict we are > > about marking functions immutable. For example, > > to_tsvector(regconfig, text) is immutable. > > Yeah. This is in fact wrong, because a TS co

Re: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Tom Lane
Alexander Korotkov writes: > I personally don't have an exact understanding of how strict we are > about marking functions immutable. For example, > to_tsvector(regconfig, text) is immutable. Yeah. This is in fact wrong, because a TS configuration can *very* easily be changed by the user. We h

Re: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Tom Lane
Tomas Vondra writes: > As for the patch, I wonder if we want to make this change. I'm not very > familiar with how unaccent works, but if changes to unicode rules would > really silently break indexes, it's kinda similar to the collation > issues caused by glibc updates. And we've generally consid

Re: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Alexander Korotkov
On Sat, Oct 3, 2020 at 4:01 PM Tomas Vondra wrote: > On Sat, Oct 03, 2020 at 02:13:01PM +0200, Petru Ghita wrote: > >As instructed by Alexander Korotkov, I'm linking the patch: > > > >https://github.com/petru-ghita/postgres/commit/d6d1f340cd34db8176744ede7f0fe588d870a33f > > > > Please submit an a

Re: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Tomas Vondra
On Sat, Oct 03, 2020 at 02:13:01PM +0200, Petru Ghita wrote: As instructed by Alexander Korotkov, I'm linking the patch: https://github.com/petru-ghita/postgres/commit/d6d1f340cd34db8176744ede7f0fe588d870a33f Please submit an actual patch, not just a link to github commit. That may disappear

RE: POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Petru Ghita
As instructed by Alexander Korotkov, I'm linking the patch: https://github.com/petru-ghita/postgres/commit/d6d1f340cd34db8176744ede7f0fe588d870a33f Kind regards, petru ghita

POC: contrib/unaccent as IMMUTABLE

2020-10-03 Thread Petru Ghita
Hi, Would it be possible to mark functions in contrib/unnaccent [1] as IMMUTABLE? We would gain the possibility to use it to enforce uniqueness. I understand that the main drawback is that unicode rules are periodically updated. So it would be needed to reindex indices on unaccent() after upgrad