Re: [HACKERS] index refuses to build

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] index refuses to build
Date: 2013-06-28 23:21:18
Message-ID: 20130628232118.GD13790@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-novice

On Sun, Aug 26, 2012 at 09:47:01AM -0400, Bruce Momjian wrote:
> On Thu, Dec 29, 2011 at 10:40:19PM -0500, Tom Lane wrote:
> > 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.
>
> Should we change the function signature for unaccent(regdictionary,
> text)?

Did we decide not to do this?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message 'Bruce Momjian' 2013-06-28 23:28:07 Re: Minor inheritance/check bug: Inconsistent behavior
Previous Message Bruce Momjian 2013-06-28 23:14:28 Re: [GENERAL] pg_upgrade -u

Browse pgsql-novice by date

  From Date Subject
Next Message Brauner Oliveira 2013-07-03 13:07:33 Problem with COPY
Previous Message Sergey Konoplev 2013-06-27 16:22:00 Re: Basics fails; SELECT, UPDATE