Skip site navigation (1) Skip section navigation (2)

Re: index refuses to build

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: index refuses to build
Date: 2011-12-29 23:16:22
Message-ID: CAHyXU0wyEG8W--nUBb5O94+LyV_xCRoUBCxEnbVCQVg7nD2DpA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-novice
On Thu, Dec 29, 2011 at 5:10 PM, Jean-Yves F. Barbier <12ukwn(at)gmail(dot)com> wrote:
> Hi list,
>
> I'm wrong somewhere, but where?:
>
> CREATE INDEX tst1m_name_lu_ix ON tst1m(lower(unaccent(name)));
> ERROR:  functions in index expression must be marked IMMUTABLE
>
> Decomposing it reveals that it is the 'unaccent' part that
> blocks:
>
> CREATE INDEX tst1m_name_lu_ix ON tst1m(unaccent(name));
> ERROR:  functions in index expression must be marked IMMUTABLE
>
> From what I found on the web I also tried to cast it to text,
> but the error's still here:(

your problem is the unaccent function.  it's defined stable because
the rules function it depends on can change after the index is built
-- that would effectively introduce index corruption.  it's possible
to bypass that restriction, but are you sure that's what you want to
do?

merlin

In response to

Responses

pgsql-novice by date

Next:From: Jean-Yves F. BarbierDate: 2011-12-29 23:33:46
Subject: Re: index refuses to build
Previous:From: Jean-Yves F. BarbierDate: 2011-12-29 23:10:01
Subject: index refuses to build

pgsql-hackers by date

Next:From: Jean-Yves F. BarbierDate: 2011-12-29 23:33:46
Subject: Re: index refuses to build
Previous:From: Tom LaneDate: 2011-12-29 23:13:31
Subject: Re: SEGFAULT on SELECT * FROM view

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group