Re: Expression indexes and dependecies - Mailing list pgsql-hackers

From Claudio Freire
Subject Re: Expression indexes and dependecies
Date
Msg-id CAGTBQpYCGUyOHx1D6HHDadOaX5BMLrrTiMFVT9sudFWeEJW94A@mail.gmail.com
Whole thread Raw
In response to Re: Expression indexes and dependecies  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Mon, Jul 22, 2013 at 6:04 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> 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.

What about a warning and leave it to the dba to reindex?



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Expression indexes and dependecies
Next
From: Andres Freund
Date:
Subject: Re: Expression indexes and dependecies