In article <CAFj8pRDx6JLmneV30kWNrcwzGLOSqyK-qN7T4_N37L9UPd2M=Q@mail.gmail.com>,
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2011/9/25 pasman pasmański <pasman.p@gmail.com>:
>> I found second use case. Look at expression:
>>
>> where left(str,n)='value'
>>
>> function left(str,n) increase monotonically for str and n. With this
>> feature it can use index on str.
>>
>> Classic index needs recreating.
>>
> these use cases are just theory - for example - this case should be
> solved with immutable functions
> I can use a functional index left(str, const) and use a query
> where left(str, const) = left('value', const) and left(str, n) = 'value'
> There are a theoretical cases, but these cases should be solved via
> special data type and GiST index
If I don't misunderstand you, this data type is called 'prefix_range',
available at PgFoundry.