Greg Stark wrote:
> Well I'm not sure whether you caught it, but Tom did come up with a
> work-around that works with the current infrastructure if all the
columns
> involved are the same datatype.
>
> You can create a regular btree index on the expression array[a,b,c]
and
> then
> do your lookup using array[a,b,c] > array[a1,b1,c1].
Unfortunately, ISAM files allow keys based on combinations of fields on
any type. So this is not an option. (I have spent over 6 months
researching this problem).
However, this would work:
Create index on t(stackparam(array[a::text,b::text,c::text),
array['char(2)', 'int', 'date')];
With the 'type strings' queried out in advance. stackparam(text[],
text[]) is a C function with uses the types and cats the strings
together in such a way that preserves sorting. In any case, this is an
ugly and inefficient mess, and I have no desire to do this unless there
is no other way. I would much rather see postgres 'get' (a,b,c) > (a1,
b1, c1)...if there is even a chance this is possible, I'll direct my
efforts there. IMNSHO, this form was invented by the SQL folks for
dealing with data in an ISAM manner, postgres should be able do it and
do it well.
Merlin