PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

La funzione PostgreSQL definita dall'utente nel dialetto di ibernazione genera un'eccezione

Ho affrontato il problema simile. Il problema era il seguente:

La funzione è stata creata nello schema particolare TEST_SCHEMA . Quando ho utilizzato la seguente configurazione:

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

Ho:

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.

Ma quando ho specificato lo schema predefinito in modo esplicito nell'URL di connessione come di seguito

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

la mia funzione è diventata visibile.