jdbc驱动依赖
<dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId><scope>runtime</scope></dependency>
yml配置
在url里使用currentSchema参数指定schema
9.3版本以前使用searchpath参数
不能直接用spring.datasource.schema配置
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/postgres?currentSchema=${spring.datasource.schema-name}
schema-name: test
username: mogdb
password: 1234
platform: postgres
hikari:
connection-timeout: 30000
minimum-idle: 5
maximum-pool-size: 30
idle-timeout: 30000
max-lifetime: 120000
auto-commit: true
connection-test-query: SELECT 1
