Received: from candle.pha.pa.us (maillist@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.9.2/8.9.1) with ESMTP id JAA41722 for ; Mon, 15 Mar 1999 09:53:59 -0500 (EST) (envelope-from maillist@candle.pha.pa.us) Received: (from maillist@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id JAA12863; Mon, 15 Mar 1999 09:53:15 -0500 (EST) From: Bruce Momjian Message-Id: <199903151453.JAA12863@candle.pha.pa.us> Subject: Re: [HACKERS] Re: [SQL] Functional Indexes In-Reply-To: <20086.918322067@sss.pgh.pa.us> from Tom Lane at "Feb 6, 1999 12:27:47 pm" To: tgl@sss.pgh.pa.us (Tom Lane) Date: Mon, 15 Mar 1999 09:53:15 -0500 (EST) Cc: bryan@arcamax.com, pgsql-sql@hub.org, pgsql-hackers@postgreSQL.org X-Mailer: ELM [version 2.4ME+ PL47 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On the TODO list: * allow creation of functional indexes to use default types > "Bryan White" writes: > > The documentation for CREATE INDEX implies that functions are allowed in > > index definitions but when I execute: > > create unique index idxtest on customer (lower(email)); > > the result is: > > ERROR: DefineIndex: (null) class not found > > Should this work? Do I have the syntax wrong? > > I tried this wih 6.4.2 and found that it was only accepted if I > explicitly identified which index operator class to use: > > play=> create table customer (email text); > CREATE > play=> create unique index idxtest on customer (lower(email)); > ERROR: DefineIndex: class not found > play=> create unique index idxtest on customer (lower(email) text_ops); > CREATE > play=> > > That'll do as a workaround for Bryan, but isn't this a bug? Surely > the system ought to know what type the result of lower() is... > > regards, tom lane > > -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026