Reputation: 4180
I've looked at these questions:
But neither of them quite answer my question. I'm trying to search an entire PostgreSQL database and list the name of every schema in it that contains a "groups" table.
I'm thinking something like:
SELECT * FROM information_schema.tables WHERE table_name='groups';
But that's still missing how to get the containing schemas.
Upvotes: 0
Views: 1977
Reputation: 13534
SELECT DISTINCT table_schema
FROM information_schema.tables
WHERE table_name='yourtablename';
Upvotes: 6