0

I have installed the PostgreSQL pg_simialrity extension as described here so that I can use the jarowinkler function. The function works perfectly in pgAdmin but not via Spring JDBC. When executed via JDBC this error is reported

org.postgresql.util.PSQLException: ERROR: function jarowinkler(text, text) does not exist

Does anyone know what needs to be done to fix this problem? I am using PostgreSQL 14.0, Java 8, Spring JDBC 4.3.25.RELEASE and PostgreSQL JDBC Driver 42.2.23

Thanks.

SME
  • 489
  • 1
  • 10
  • 21
  • 2
    1) You are not connecting to same database. 2) Your are connecting to same database, but the [search_path](https://www.postgresql.org/docs/15/ddl-schemas.html#DDL-SCHEMAS-PATH) is set different for the connection and the function is not being found. Try schema qualifying function name. – Adrian Klaver Dec 02 '22 at 19:03
  • Thanks Adrian. I am connecting to the same database. Also as this function is an extension should it not be available to all schemas? – SME Dec 06 '22 at 09:33
  • 1
    1) The `search_path` is independent of the extension creation process and I would be wary of any extension that tried to modify it as `search_path` is a security feature. 2) In `psql` do `\df *.jarowinkler` to find where the function is installed. – Adrian Klaver Dec 06 '22 at 16:06

0 Answers0