Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 05C8F4762A0 for ; Wed, 5 Jun 2002 15:19:53 -0400 (EDT) Received: from megazone.bigpanda.com (unknown [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 87DD54763B1 for ; Wed, 5 Jun 2002 15:17:11 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 26531D605; Wed, 5 Jun 2002 12:15:52 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 1C03A5C01; Wed, 5 Jun 2002 12:15:52 -0700 (PDT) Date: Wed, 5 Jun 2002 12:15:52 -0700 (PDT) From: Stephan Szabo To: Josh Berkus Cc: Subject: Re: Indexing Metaphone? In-Reply-To: <200206051112.02090.josh@agliodbs.com> Message-ID: <20020605121507.B16840-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200206/44 X-Sequence-Number: 8009 On Wed, 5 Jun 2002, Josh Berkus wrote: > Folks, > > I'm building a database that does a lot of fuzzy-string searches. As such, > I'd like to index the metaphone results of certain columns. However, I get > this when I try: > > jwnet=> CREATE INDEX idx_locations_metaphone ON > locations(metaphone(location_name, 12)); > ERROR: parser: parse error at or near "12" Functional indexes only take columns as arguments IIRC. Make a cachable function that returns metaphone($1, 12) given the appropriate type and index/use that. :)