PSQLException: ERROR: relation “TABLE_NAME” does not exist

You need to specify the schema name in the Spring’s Hibernate properties, not in the JDBC connection URL:

<prop key="hibernate.default_schema">SCHEMA_NAME</prop>

That said, your JDBC connection URL is in fact syntactically invalid. According to the PostgreSQL JDBC documentation you have to use one of the following syntaxes:

  • jdbc:postgresql:database
  • jdbc:postgresql://host/database
  • jdbc:postgresql://host:port/database

The database is here the database name. If the host is left away, it will default to localhost. If the port number is left away, it will just default to 5432. Thus, one of the following is valid in your case:

  • jdbc:postgresql:DB_NAME
  • jdbc:postgresql://localhost/DB_NAME
  • jdbc:postgresql://localhost:5432/DB_NAME

Leave a Comment

tech