0

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.

Community
  • 1
  • 1
singmotor
  • 3,930
  • 12
  • 45
  • 79

1 Answers1

6
SELECT DISTINCT table_schema
  FROM information_schema.tables
 WHERE table_name='yourtablename'; 
Teja
  • 13,214
  • 36
  • 93
  • 155