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

Re: [NOVICE] index refuses to build

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [NOVICE] index refuses to build
Date: 2011-12-30 03:40:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-novice
Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
> On Thu, Dec 29, 2011 at 5:10 PM, Jean-Yves F. Barbier <12ukwn(at)gmail(dot)com> wrote:
>> CREATE INDEX tst1m_name_lu_ix ON tst1m(unaccent(name));
>> ERROR:  functions in index expression must be marked IMMUTABLE

> 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?

Hmm ... it's clear why unaccent(text) is only stable, because it depends
on the current search_path to find the "unaccent" dictionary.  But I
wonder whether it was an oversight that unaccent(regdictionary, text)
is stable and not immutable.  We don't normally mark functions as stable
just because you could in principle change their behavior by altering
some outside-the-database configuration files.

			regards, tom lane

In response to


pgsql-novice by date

Next:From: cjanDate: 2011-12-30 05:45:13
Subject: how to back up the data base of POSTGRESQL and Restore it?
Previous:From: Jean-Yves F. BarbierDate: 2011-12-29 23:33:46
Subject: Re: index refuses to build

pgsql-hackers by date

Next:From: Manabu OriDate: 2011-12-30 05:47:23
Subject: spinlocks on powerpc
Previous:From: Alvaro HerreraDate: 2011-12-30 02:11:22
Subject: Re: [RFC] grants vs. inherited tables

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