Re: Dynamic Partial Index - Mailing list pgsql-general

From Jeff Davis
Subject Re: Dynamic Partial Index
Date
Msg-id 1155838687.26280.6.camel@dogma.v10.wvs
Whole thread Raw
In response to Dynamic Partial Index  (gustavo halperin <ggh.develop@gmail.com>)
Responses Re: Dynamic Partial Index  (gustavo halperin <ggh.develop@gmail.com>)
List pgsql-general
On Thu, 2006-08-17 at 20:50 +0300, gustavo halperin wrote:
> I'm interesting in a partial index for a rows that aren't older than 6
> mounts, something like the sentence below:
>
--------------------------------------------------------------------------------------------------------------------------------------------------
>     /CREATE INDEX name_for_the_index ON table (the_column_of_type_date)
>
>     WHERE ( the_column_of_type_date > (current_date - interval '6
> month')::date );/
>
--------------------------------------------------------------------------------------------------------------------------------------------------
> But this is not posible, I receive the next error:
>
--------------------------------------------------------------------------------------------------------------------------------------------------
>    ERROR:  functions in index predicate must be marked IMMUTABLE
>
--------------------------------------------------------------------------------------------------------------------------------------------------
> So, what is the best solution for my problem?

Create an index on the table, and then periodically move records into a
separate archive table.

Regards,
    Jeff Davis


pgsql-general by date:

Previous
From: gustavo halperin
Date:
Subject: Dynamic Partial Index
Next
From: Vivek Khera
Date:
Subject: Re: autovacuum = on ignored