Re: Expression indexes and dependecies

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Expression indexes and dependecies
Date: 2013-07-22 21:14:40
Message-ID: 20130722211440.GE752@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-07-22 17:04:06 -0400, Alvaro Herrera wrote:
> Pavan Deolasee escribió:
> > Hello,
> >
> > While doing some tests, I observed that expression indexes can malfunction
> > if the underlying expression changes.
>
> [...]
>
> > Perhaps this is a known behaviour/limitation, but I could not find that in
> > the documentation. But I wonder if it makes sense to check for dependencies
> > during function alteration and complain. Or there are other reasons why we
> > can't do that and its a much larger problem than what I'm imagining ?
>
> This is a tough problem. The dependency mechanism has no way to keep
> track of this kind of dependency; all it does is prevent the function
> from being dropped altogether, but preventing it from acquiring a
> conflicting definition is outside its charter.
>
> One way to attack this would be registering dependencies of a new kind
> on functions used by index expressions. Then CREATE OR REPLACE function
> could reject alteration for such functions. I don't know if we care
> enough about this case.

I think changing the results of a immutable function violates the
contract enough to make this the user's fault. Also the other solutions
seem hard to achieve ;)

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2013-07-22 21:39:35 Comma Comma Comma 8601
Previous Message Claudio Freire 2013-07-22 21:12:10 Re: Expression indexes and dependecies