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

indexes on functions and create or replace function

From: "Matthew Dennis" <mdennis(at)merfer(dot)net>
To: PGSQL <pgsql-general(at)postgresql(dot)org>
Subject: indexes on functions and create or replace function
Date: 2008-08-28 05:30:07
Message-ID: e94d85500808272230l10cf9a81jc7dda68b9302bb9@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
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.

Responses

pgsql-general by date

Next:From: Richard BroersmaDate: 2008-08-28 05:58:03
Subject: Feature Request: additional extension to UPDATE
Previous:From: Tom LaneDate: 2008-08-28 05:12:59
Subject: Re: 8.3.1 query plan

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