Re: indexes on functions and create or replace function - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: indexes on functions and create or replace function
Date
Msg-id 48BBEFB6.5050200@gmx.net
Whole thread Raw
In response to indexes on functions and create or replace function  ("Matthew Dennis" <mdennis@merfer.net>)
List pgsql-general
Matthew Dennis wrote:
> Given table T(c1 int) and function F(arg int) create an index on T using
> F(c1).  It appears that if you execute "create or replace function F"
> and provide a different implementation that the index still contains the
> results from the original implementation, thus if you execute something
> like "select * from T where F(c1)" after replacing the function that it
> now misses rows that should be returned.  In other words, the index
> isn't aware the function is now returning different values.  That's not
> the correct/expected behavior is it?  I would have expected that
> replacing the function would have caused any indexes that depend on that
> function to be reindexed/recreated with the new function implementation.

I have added a Todo item about this.  But as you see, the problem is
quite large and involved.

pgsql-general by date:

Previous
From: Aaron Burnett
Date:
Subject: Re: Assistance with SQL
Next
From: Peter Eisentraut
Date:
Subject: Re: SQL optimization - WHERE SomeField STARTING WITH ...