PostgreSQL
 sql >> Base de données >  >> RDS >> PostgreSQL

La fonction PostgreSQL définie par l'utilisateur dans le dialecte hibernate lève une exception

J'ai été confronté au problème similaire. Le problème était le suivant :

La fonction a été créée dans le schéma particulier TEST_SCHEMA . Lorsque j'ai utilisé la configuration suivante :

<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/postgres</property>
<property name="hibernate.default_schema">TEST_SCHEMA</property>

J'ai :

org.postgresql.util.PSQLException: ERROR: function levenshtein(character varying, character varying) does not exist. No function matches the given name and argument types. You might need to add explicit type casts.

Mais, lorsque j'ai spécifié le schéma par défaut explicitement dans l'url de connexion comme ci-dessous

<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/postgres?currentSchema=TEST_SCHEMA</property>

ma fonction est devenue visible.