简体   繁体   中英

Migrating Spring boot JPA(MySQL) to JPA(PostgreSQL) throws an ERROR

I have a spring boot web application with JPA and MySQL is the database. I have to migrate from MySQL DB to PostgreSQL. Some of the table(entity) cause to ERROR while configuring PostgreSQL to application.

'create' option of the JPA is working properly. but when changing create to 'update' program is terminating with error.

The error is

'column i.indproc does not exist Hint: Perhaps you meant to reference the column "i.indpred". Position: 610'

ERROR 31134 --- [  restartedMain] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory'..... [PersistenceUnit: default] Unable to build Hibernate SessionFactory at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

n.SQLGrammarException: Error accessing index information: table_user

Caused by: org.postgresql.util.PSQLException: ERROR: column i.indproc does not exist

I hit similar errors. Upgrading the postgreql maven dependency to the latest version fixed my errors. In Aug 2019, it's

    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>42.2.6</version>
    </dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM