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

Re: indexes on functions and create or replace function

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Matthew Dennis" <mdennis(at)merfer(dot)net>, PGSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: indexes on functions and create or replace function
Date: 2008-08-28 14:57:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Since determining whether the function actually did change behavior is
> Turing-complete, we can't realistically try to determine that in software.
> So we leave it up to the user to reindex if he makes a behavioral change in
> an indexed function.

Another option might be to mark the index invalid. Then allow the user to
either reindex the index to enable it or use a magic DBA-only command to
enable it asserting that a rebuild isn't necessary.

Then of course someone would complain about the downtime caused by queries not
using the index during the unavoidable window when the index is invalid. I'm
not sure how to solve that.

  Gregory Stark
  Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

In response to

pgsql-general by date

Next:From: Jaime CasanovaDate: 2008-08-28 14:58:17
Subject: Re: Vaccuum best practice: cronjob or autovaccuum?
Previous:From: John T. DowDate: 2008-08-28 14:57:40
Subject: WAL file questions - how to relocate on Windows, how to replay after total loss, etc

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