Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA00095; Fri, 18 Jun 93 09:09:05 -0700
Date: Fri, 18 Jun 93 09:09:05 -0700
Message-Id: <9306181609.AA00095@postgres.Berkeley.EDU>
From: ruby!imram@colossus.apple.com (Steve Davidson)
Subject: Indexing and arrays
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu

Can an index be placed on an array?

I'd like to know if an index placed on an array field
applies to each element of the array.  For instance:

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

retrieve (TEST.all) where words=orange



---Firstly, the define index fails:
DefineIndex: attribute "words" not found

---Second, I don't think the retrieve would have worked even if
   the define had worked.  Notice I did not say "words[n]", just 
   "words".

I need a variable length text field with an index on each element
of the array.  Does anybody know how to do this?

              --------======= * =======--------
                       Steven Davidson
                       steved@cfcl.com
