缺少模糊字符串匹配扩展 pgadmin
Missing fuzzystringmatch extension pg admin
我最近遇到了一个问题,java 休眠尝试执行查询时出现以下输出。
Caused by: org.postgresql.util.PSQLException: ERRORE: la funzione levenshtein_less_equal(text, character varying, integer) non esiste
Suggerimento: Nessuna funzione trovata con nome e tipi di argomenti forniti. Potrebbe essere necessario convertire i tipi esplicitamente.
Posizione: 464
对于错误的意大利语日志,我们深表歉意,基本上是说该函数不存在那种参数。我检查了我在数据库上的函数,我有一个函数叫做:
levenshtein_less_equal(text, text, integer)
现在,首先我不明白为什么 query.setparameter
on java,用字符串设置函数的第一个和第二个参数会以这样的函数调用结束
levenshtein_less_equal(text, character varying, integer)
两者都是字符串,但一个映射到文本,一个映射到不同的字符??
其次,我不明白为什么我通过向数据库扩展添加 fuzzystrmatch 扩展来解决这个问题。
levenshtein_less_equal(text, text, integer)
是一个在 postgres 中比较两个字符串的函数,它是 Fuzzymatch 模块的一部分,该模块包含获取字符串之间距离的函数,请参见:fuzzystrmatch, one of the ways to compare string is called the Levenshtein distance.
当您在 Hibernate 中执行 setParameter()
时,您会间接触发字符串比较,我没有看到您的数据,但我认为您的数据具有特殊字符,这里是 link 到堆栈溢出讨论同一问题的问题:link.
所以这里基本上发生的事情是 Postgres 试图获得它不理解的字符串的近似值以获得匹配并且它正在使用 Levenshtein 距离来做到这一点。
我最近遇到了一个问题,java 休眠尝试执行查询时出现以下输出。
Caused by: org.postgresql.util.PSQLException: ERRORE: la funzione levenshtein_less_equal(text, character varying, integer) non esiste
Suggerimento: Nessuna funzione trovata con nome e tipi di argomenti forniti. Potrebbe essere necessario convertire i tipi esplicitamente.
Posizione: 464
对于错误的意大利语日志,我们深表歉意,基本上是说该函数不存在那种参数。我检查了我在数据库上的函数,我有一个函数叫做:
levenshtein_less_equal(text, text, integer)
现在,首先我不明白为什么 query.setparameter
on java,用字符串设置函数的第一个和第二个参数会以这样的函数调用结束
levenshtein_less_equal(text, character varying, integer)
两者都是字符串,但一个映射到文本,一个映射到不同的字符??
其次,我不明白为什么我通过向数据库扩展添加 fuzzystrmatch 扩展来解决这个问题。
levenshtein_less_equal(text, text, integer)
是一个在 postgres 中比较两个字符串的函数,它是 Fuzzymatch 模块的一部分,该模块包含获取字符串之间距离的函数,请参见:fuzzystrmatch, one of the ways to compare string is called the Levenshtein distance.
当您在 Hibernate 中执行 setParameter()
时,您会间接触发字符串比较,我没有看到您的数据,但我认为您的数据具有特殊字符,这里是 link 到堆栈溢出讨论同一问题的问题:link.
所以这里基本上发生的事情是 Postgres 试图获得它不理解的字符串的近似值以获得匹配并且它正在使用 Levenshtein 距离来做到这一点。