【发布时间】:2020-08-19 03:35:49
【问题描述】:
我有一个 Spring Boot 应用程序在 H2 DB 上运行良好。如果我想切换到 postgresQL,我会收到错误。
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.username=postgres
错误:
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "drop table if exists
user cascade" via JDBC Statement
...
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "user"
...
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table user (id int8 not null, active int4 not null, first_name varchar(255), last_name varchar(255), password varchar(255), role varchar(255), username varchar(255), primary key (id))" via JDBC Statement
【问题讨论】:
标签: java spring postgresql h2