Database 数据类型字符变量没有access method“的默认运算符类;要点;

Database 数据类型字符变量没有access method“的默认运算符类;要点;,database,postgresql,exception,Database,Postgresql,Exception,我尝试执行以下命令(Postgresql): 我收到了以下错误消息: ERROR: data type character varying has no default operator class for access method "gist" HINT: You must specify an operator class for the index or define a default operator class for the data type. 我做了大量的谷歌搜索,但我

我尝试执行以下命令(Postgresql):

我收到了以下错误消息:

ERROR:  data type character varying has no default operator class for access method "gist"
HINT:  You must specify an operator class for the index or define a default operator class for the data type.
我做了大量的谷歌搜索,但我无法将其翻译成简单的英语。我应该如何执行上面的命令?
“方法”的类型是字符变化的,“验证器”是文本,“validfrom”,“validuntil”是日期。

对于
验证器
方法
,使用简单的唯一约束。text和varchar()在索引方面是相同的

这意味着三个ALTERTABLE语句而不是一个,但它应该可以避免这些问题。盒子应该适当地支持GiST,所以你们在那个里应该很好

在简单的英语中,错误是告诉您该数据类型不支持该索引类型预期的索引操作。例如,文本字符串不能通过索引来搜索它们是否重叠。换句话说,三者不能放在同一个约束中

此外,请记住,唯一约束比排除约束更快,因此,在它们工作的地方,最好使用唯一约束

ERROR:  data type character varying has no default operator class for access method "gist"
HINT:  You must specify an operator class for the index or define a default operator class for the data type.