Search Postgresql Archives

Re: Dynamic partial index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In article <44E4A209.4080106@xxxxxxxxx>,
gustavo halperin <ggusti@xxxxxxxxx> writes:

>  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?

Use a fixed date 6 months ago, and regularly recreate the index.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux