postgresql - Indexing column for full text search -


i have column col data type character varying

i need index column gin index. if trying directly set gin index column, returned error:

data type character varying has no default operator class access method "gin" hint: must specify operator class index or define default operator class data type

if trying:

 create index col_vector   on mytable   using gin (to_tsvector(col)) 

i got error: functions in index expression must marked immutable

how create gin index character varying column ?

p.s. need full text search

try code:

create index "name " on "tablename" using gin(to_tsvector('english', "columnname")); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -