Re: text type has no default operator class for GIN?
От | Sam Mason |
---|---|
Тема | Re: text type has no default operator class for GIN? |
Дата | |
Msg-id | 20090818234721.GS5407@samason.me.uk обсуждение исходный текст |
Ответ на | Re: text type has no default operator class for GIN? (Bob Gobeille <bob.gobeille@hp.com>) |
Ответы |
Re: text type has no default operator class for GIN?
|
Список | pgsql-general |
On Tue, Aug 18, 2009 at 03:50:47PM -0600, Bob Gobeille wrote: > On Aug 18, 2009, at 3:46 PM, Gobeille, Robert 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" > >HINT: You must specify an operator class for the index or define a > >default operator class for the data type. [..] > I still don't understand the above, but the following works: > > create index ufile_name_ginidx on uploadtree using > gin(to_tsvector('english', ufile_name)); 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. When PG refuses to create a GIN index on a plain TEXT column it's saying that it doesn't how to use those operators with a values of TEXT type. As soon as you pull this value apart (with the to_tsvector) you end up with something that PG can get some traction on and all is good. Maybe a useful question to ask is, what are you expecting PG do to when you create a GIN index on this TEXT column? -- Sam http://samason.me.uk/
В списке pgsql-general по дате отправления: