Dynamic Partial Index - Mailing list pgsql-general

From gustavo halperin
Subject Dynamic Partial Index
Date
Msg-id 44E4AC67.3070802@gmail.com
Whole thread Raw
Responses Re: Dynamic Partial Index  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-general
Hello

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?

Thank you,
      Gustavo

pgsql-general by date:

Previous
From: Eric
Date:
Subject: Troubles linking with libpqxx
Next
From: Jeff Davis
Date:
Subject: Re: Dynamic Partial Index