Re: ARRAYs and INDEXes ... - Mailing list pgsql-sql

From Greg Stark
Subject Re: ARRAYs and INDEXes ...
Date
Msg-id 877jemvsfj.fsf@stark.xeocode.com
Whole thread Raw
In response to ARRAYs and INDEXes ...  ("Marc G. Fournier" <scrappy@postgresql.org>)
List pgsql-sql
"Marc G. Fournier" <scrappy@postgresql.org> writes:

> SELECT * FROM customers WHERE monthly_balance[6] = 0.00;

This, like the other poster said, can be accomplished with a set of simple
expression indexes.

> As an example ... or
> 
> SELECT * FROM customers WHERE 0.00 = any (monthly_balance);

This would require a GiST index. Look at the intarray contrib module. I don't
think there's any equivalent for other data types. You might have to store
these values as fixed precision numbers and divide or multiple by 100 to
convert.

-- 
greg



pgsql-sql by date:

Previous
From: The One
Date:
Subject: What libraries need to be included in C program for encrypt and decrypt functions?
Next
From: "Owen Jacobson"
Date:
Subject: Re: What libraries need to be included in C program for encrypt and decrypt functions?