springboot postgresql 数据库启动检测报错checkDataSource 这个表pg中不存在吗
@Override
public void checkDataSource(Connection conn) throws SQLException {
if (log.isDebugEnabled()) {
String sql = "SELECT * FROM information_schema.character_sets";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
for (String name : Arrays.asList("character_set_catalog",
"character_set_schema",
"character_set_name",
"character_repertoire",
"form_of_use",
"default_collate_catalog",
"default_collate_schema",
"default_collate_name")) {
log.debugf("Postgresql : %s=%s", name, rs.getString(name));
}
}
rs.close();
// 打印当前数据库名称
rs = stmt.executeQuery("SELECT CURRENT_DATABASE()");
if (rs.next()) {
log.debug("Postgresql : database=" + rs.getString(1));
}
rs.close();
// 打印当前连接用户名
rs = stmt.executeQuery("SELECT CURRENT_USER");
if (rs.next()) {
log.debug("Postgresql : user=" + rs.getString(1));
}
rs.close();
stmt.close();
}
}
2021-06-24 16:26:03.927 DEBUG [ main] [] org.nutz.dao.jdbc.Jdbcs [90] : Jdbcs init complete
2021-06-24 16:26:04.019 INFO [ main] [] org.nutz.dao.jdbc.Jdbcs [103] : Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
2021-06-24 16:26:04.050 INFO [ main] [] com.zaxxer.hikari.HikariDataSource [110] : HikariPool-1 - Starting...
2021-06-24 16:26:05.168 INFO [ main] [] com.zaxxer.hikari.HikariDataSource [123] : HikariPool-1 - Start completed.
2021-06-24 16:26:09.143 DEBUG [ main] [] org.nutz.dao.impl.DaoSupport [190] : select expert : org.nutz.dao.impl.jdbc.psql.PsqlJdbcExpert
2021-06-24 16:26:30.914 DEBUG [ main] [] org.nutz.dao.impl.DaoSupport [201] : JDBC Driver --> 42.2.8
2021-06-24 16:26:30.917 DEBUG [ main] [] org.nutz.dao.impl.DaoSupport [202] : JDBC Name --> PostgreSQL JDBC Driver
2021-06-24 16:26:30.920 DEBUG [ main] [] org.nutz.dao.impl.DaoSupport [204] : JDBC URL --> jdbc:postgresql://36.110.98.226:45432/ttsec2_0?useUnicode=true&characterEncoding=UTF-8
2021-06-24 16:27:26.773 INFO [ main] [] org.nutz.dao.impl.DaoSupport [218] : something wrong when checking DataSource
org.postgresql.util.PSQLException: ERROR: relation "information_schema.character_sets" does not exist
位置:15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2497)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2233)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:310)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:446)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:370)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:311)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:297)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:274)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:225)
at com.zaxxer.hikari.pool.ProxyStatement.executeQuery(ProxyStatement.java:111)
at com.zaxxer.hikari.pool.HikariProxyStatement.executeQuery(HikariProxyStatement.java)
at org.nutz.dao.impl.jdbc.psql.PsqlJdbcExpert.checkDataSource(PsqlJdbcExpert.java:191)
at org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:215)
at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:163)
at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:130)
at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:97)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:86)
at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:242)
at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:195)
at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:180)
at org.nutz.dao.impl.NutDao.<init>(NutDao.java:108)