Re: BUG #5781: unaccent() function should be marked IMMUTABLE

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Grant Hutchins and Peter Jaros <grant(at)pivotallabs(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5781: unaccent() function should be marked IMMUTABLE
Date: 2010-12-27 20:35:02
Message-ID: 201012272035.oBRKZ2Y27272@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Robert Haas wrote:
> On Wed, Dec 22, 2010 at 8:45 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > Tom Lane wrote:
> >> "Grant Hutchins and Peter Jaros" <grant(at)pivotallabs(dot)com> writes:
> >> > The unaccent(text) function supplied by contrib/unaccent is marked VOLATILE.
> >> > This prevents it from being used in indexes. We believe that the function
> >> > meets the requirements to be marked IMMUTABLE.
> >>
> >> No, it most certainly doesn't. ?It depends on the behavior of a
> >> dictionary that it has no hard-wired connection to, so the specific
> >> behavior of the dictionary is uncertain. ?Even if you're willing to
> >> assume that the dictionary being used is the one defined by this
> >> module, that dictionary depends on external configuration files
> >> which are easily changeable.
> >>
> >> Arguably it'd be reasonable to change the function's marking from
> >> volatile to stable, but that's not going to be enough to allow use in
> >> indexes.
> >
> > So, should we change unaccent() from VOLATILE to STABLE?
>
> Sounds like it, but it doesn't sound like it will help much. :-(

OK, done, with attached, applied patch.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachment Content-Type Size
/rtmp/unaccent.diff text/x-diff 994 bytes

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2010-12-27 21:14:19 Re: BUG #5784: CREATE INDEX USING GIN complains about array containing null values yet none exist
Previous Message Kevin Grittner 2010-12-27 19:54:53 Re: IN clause on BYTEA column works against table directly but gives error against view