我看过这些问题:
但他们都没有完全回答我的问题。我正在尝试搜索整个PostgreSQL数据库并列出其中包含“组”表的每个模式的名称。
我在想:
SELECT * FROM information_schema.tables WHERE table_name='groups';
但是仍然缺少如何获取包含模式。
答案 0 :(得分:4)
SELECT DISTINCT table_schema
FROM information_schema.tables
WHERE table_name='yourtablename';