【问题标题】:Migrating Spring boot JPA(MySQL) to JPA(PostgreSQL) throws an ERROR将 Spring boot JPA(MySQL) 迁移到 JPA(PostgreSQL) 会引发错误
【发布时间】:2019-03-06 11:22:48
【问题描述】:

我有一个带有 JPA 的 Spring Boot Web 应用程序,数据库是 MySQL。我必须从 MySQL DB 迁移到 PostgreSQL。 在将 PostgreSQL 配置到应用程序时,某些表(实体)会导致 ERROR。

JPA 的'create' 选项工作正常。 但是当将 create 更改为 'update' 时,程序会因错误而终止。

错误是

'列 i.indproc 不存在 提示:也许您的意思是引用“i.indpred”列。 位置: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.indproc 列不存在。我们还能提供什么帮助?
  • 删除数据库并直接使用更新。
  • 我的源代码中的任何地方都没有i.indproc 命名列

标签: java mysql postgresql spring-boot jpa


【解决方案1】:

我遇到了类似的错误。 将 postgreql maven 依赖项升级到最新版本修复了我的错误。 2019 年 8 月是

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

【讨论】:

    猜你喜欢
    • 2018-12-02
    • 2017-11-17
    • 1970-01-01
    • 1970-01-01
    • 2018-04-16
    • 2018-06-15
    • 2019-01-22
    • 2021-07-26
    • 2017-06-24
    相关资源
    最近更新 更多