Re: BUG #5781: unaccent() function should be marked IMMUTABLE - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5781: unaccent() function should be marked IMMUTABLE
Date
Msg-id 24718.1291483842@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #5781: unaccent() function should be marked IMMUTABLE  (Greg Stark <gsstark@mit.edu>)
List pgsql-bugs
Greg Stark <gsstark@mit.edu> writes:
> On Fri, Dec 3, 2010 at 4:50 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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.

> Don't we have precedent for this in assuming that things like tsearch
> dictionaries and parsers and system locales don't change underneath
> us?

The precedent is to assume such things are stable, not immutable.

Even if you want to assume that, the implementation of unaccent(text) is
such that its results depend on search_path, which is *definitely* not
acceptable for an immutable function.  It would need a better way of
tying the function to the dictionary.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Hiroshi Saito"
Date:
Subject: Re: No UUID support on One-Click installer PostgreSQL 9.0.1 64-bit Windows
Next
From: tmoore
Date:
Subject: TRUNCATE HANGS