Subject: Indexing a variable-length array Subject: Indexing a variable-length array

From: [email-masked] (Steve Davidson)
Date: Tue, 22 Jun 93 22:38:21 -0700

Subject: Indexing a variable-length array

I need to implement an indexing scheme on a variable-length array.

1) Does an index placed on an array apply to all the array members?
2) How do I query all elements of an array at the same time?

create TEST (words=text[])
define index i_words on TEST using btree (words text_ops)
append TEST (words="{fruit, orange, citrus}") 
retrieve (TEST.all) where TEST.words = "orange"

The "retrieve" does not work:

WARN:Jun 22 21:02:58:OperatorDef: no operator =

(I know why I got the error.  I just don't know how to get what I need).

I received some advice.  

"If you have a function that takes an array as an argument,
you can define an index on the result of the function."
   (thanks mike)

Can someone help me implement this?:

              --------======= * =======--------
                       Steven Davidson
                       [email-masked]