PostgreSQL模糊匹配扩展给出错误

时间:2018-10-26 09:41:51

标签: postgresql fuzzy-logic

我正在使用AWS上托管的PostgreSQL DB。我正在尝试使用模糊逻辑,已成功启用其扩展。 但是运行挑剔的匹配查询给了我一个例外。也已验证,该扩展名已启用,但查询失败。

**Query used to enable extension** - CREATE EXTENSION pg_trgm;
**DB version details** - PostgreSQL 9.6.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16), 64-bit
**Query for fuzzy match** - SELECT first_name FROM contact WHERE first_name % 'Eve' LIMIT 10;

**Error message -** SQL Error [42883]: ERROR: operator does not exist: character varying % unknown
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 49
  org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying % unknown
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 49

0 个答案:

没有答案