我有一个带有 JPA 的 Spring Boot Web 应用程序,MySQL 是数据库。我必须从 MySQL DB 迁移到 PostgreSQL。 将 PostgreSQL 配置到应用程序时,某些表(实体)会导致错误。
JPA 的“create”选项工作正常。 但是当将创建更改为“更新”时,程序会因错误而终止。
错误是
'列 i.indproc 不存在 提示:也许您想引用“i.indpred”列。 位置:610'
ERROR 31134 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.BeanCreationException:创建名称为“entityManagerFactory”的bean时出错.....
[PersistenceUnit:默认] 无法构建 Hibernate SessionFactory
在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
n.SQLGrammarException: Error accessing index information: table_user
由以下原因引起:org.postgresql.util.PSQLException:错误:列 i.indproc 不存在
最佳答案
我遇到了类似的错误。 将 postgreql maven 依赖项升级到最新版本修复了我的错误。 2019 年 8 月,
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.6</version>
</dependency>
关于java - 将 Spring boot JPA(MySQL) 迁移到 JPA(PostgreSQL) 会引发错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52589600/