与 Schema.getTables() 中表格的不同视图

Differenciate views from tables in Schema.getTables()

我正在使用 jOOQ 的 Schema.getTables() method to find all the tables from my schema, but I found this method also returns the views. Checking at the returned Table 对象我没有找到一种方法来识别它是 table 还是我的架构中的视图。

使用 jOOQ 只选择视图的正确方法是什么?

jOOQ目前没有办法区分:

  • Tables
  • 临时表
  • 分区表
  • Table 层次结构
  • 对象表
  • 观看次数
  • 物化视图
  • 函数
  • 其他

这是未来 jOOQ 版本的路线图: https://github.com/jOOQ/jOOQ/issues/2370

jOOQ API 本身没有简单的解决方法。您可以 运行 查询 PostgreSQL 的字典视图,但是:

SELECT table_schema, table_name, table_type
FROM information_schema.tables