【问题标题】:JDBC PostgreSQL check database for empty tables and delete themJDBC PostgreSQL 检查数据库中的空表并删除它们
【发布时间】:2018-04-19 15:11:15
【问题描述】:

我必须使用 JDBC 检查 PostgreSQL 数据库中具有空行的表,然后将它们从服务器中删除。我怎样才能做到这一点?我非常确信我必须遍历从“搜索”查询中获得的 ResultSet 对象,并将表名放在循环的 DROP 语句中,但不知道如何检索它们。

【问题讨论】:

标签: java postgresql jdbc


【解决方案1】:

查看List all tables in postgresql information_schema

简而言之,select * from information_schema.tables 显示所有表格

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-01-09
    • 2023-04-05
    • 2013-02-12
    • 1970-01-01
    • 2020-05-17
    • 2014-03-07
    • 2014-07-29
    • 2013-05-01
    相关资源
    最近更新 更多