Re: text type has no default operator class for GIN?

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: text type has no default operator class for GIN?
Date: 2009-08-19 15:14:54
Message-ID: 20090819151454.GT5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 18, 2009 at 08:21:49PM -0400, Tom Lane wrote:
> Sam Mason <sam(at)samason(dot)me(dot)uk> writes:
> > On Tue, Aug 18, 2009 at 03:50:47PM -0600, Bob Gobeille wrote:
> >>> CREATE INDEX "ufile_name_search" ON "public"."uploadtree" USING GIN
> >>> ("ufile_name");
> >>> ERROR: data type text has no default operator class for access method
> >>> "gin"
>
> > Not sure if understand very well myself, but GIN indexes can only speed
> > up specific access patterns and these are exposed through various
> > different operators.
>
> What GIN indexes are good for is indexing equality queries on the
> components of something the database otherwise thinks of as a single
> object. For instance you can GIN-index searches for arrays containing
> a particular value as a member.

Yup, that's a much better description than I could muster!

> What I suppose the OP has in mind is full-text
> searching, which is looking for component *words*. But "word" is a
> very language- and context-dependent concept.

That's what I was trying to get the OP to think about when I said "what
are you expecting PG do to when you create a GIN index on this TEXT
column" but reading it back now I was being my normal oblique self.

Writing nice emails is depressingly difficult!

--
Sam http://samason.me.uk/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bob Gobeille 2009-08-19 15:26:14 Re: text type has no default operator class for GIN?
Previous Message Randal L. Schwartz 2009-08-19 14:41:04 Re: Postgre RAISE NOTICE and PHP