Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA28978; Tue, 22 Jun 93 22:38:21 -0700
Date: Tue, 22 Jun 93 22:38:21 -0700
Message-Id: <9306230538.AA28978@postgres.Berkeley.EDU>
From: ruby!imram@colossus.apple.com (Steve Davidson)
Subject: Indexing a variable-length array Subject: Indexing a variable-length array
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu

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
                       steved@cfcl.com

