获取包含某个表名的所有模式的列表

sin*_*tor 0 sql database postgresql search schema

我看过这些问题:

但他们都没有完全回答我的问题。我正在尝试搜索整个 PostgreSQL 数据库并列出其中包含“组”表的每个模式的名称。

我在想这样的事情:

SELECT * FROM information_schema.tables WHERE table_name='groups';
Run Code Online (Sandbox Code Playgroud)

但这仍然缺少如何获取包含模式。

Tej*_*eja 5

SELECT DISTINCT table_schema
  FROM information_schema.tables
 WHERE table_name='yourtablename'; 
Run Code Online (Sandbox Code Playgroud)