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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Grant Hutchins and Peter Jaros" <grant(at)pivotallabs(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5781: unaccent() function should be marked IMMUTABLE
Date: 2010-12-03 04:50:06
Message-ID: 16472.1291351806@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"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.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Konstantin Nikiforov 2010-12-03 07:35:47 Re: Bug: table inheritance. Trigger before DELETE for each statement is ignored
Previous Message Tom Lane 2010-12-03 03:52:11 Re: Bug: table inheritance. Trigger before DELETE for each statement is ignored