Re: unaccent module - two params function should be immutable - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: unaccent module - two params function should be immutable
Date
Msg-id CAFj8pRAXf0UteRd8xLY8PRHuCUKkYttUEKkJ7rbgGLR72ntFBw@mail.gmail.com
Whole thread Raw
In response to Re: unaccent module - two params function should be immutable  (Bruce Momjian <bruce@momjian.us>)
Responses Re: unaccent module - two params function should be immutable
List pgsql-hackers



2013/9/11 Bruce Momjian <bruce@momjian.us>
On Tue, Feb 19, 2013 at 08:30:29AM +0100, Pavel Stehule wrote:
> Hello
>
> There was a proposal to change flag of function to immutable - should
> be used in indexes
>
> CREATE FUNCTION unaccent(regdictionary, text)
>         RETURNS text
>         AS 'MODULE_PATHNAME', 'unaccent_dict'
>         LANGUAGE C STABLE STRICT;
>
>
> is there any progress?

I have developed the attached patch based on your suggestion.  I did not
see anything in the code that would make it STABLE, except a lookup of a
dictionary library:

        dictOid = get_ts_dict_oid(stringToQualifiedNameList("unaccent"), false);

yes, it risk, but similar is with timezones, and other external data.

Regards

Pavel
 

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: record identical operator
Next
From: Pavel Stehule
Date:
Subject: Re: review: pgbench progress report improvements