I have a table name student and like 35 schemas in my DB.
how can i get in which schema the table student exists?
(there might be more than one in different schemas).
I've tried through pg_class but I don't know how to get schema name from there.
@John table_catalog is the name of the database containing the table. If you already know it, you can omit it from the query. And yes, this will work for views as well.
2
select schemaname,relname from pg_stat_user_tables;
Example:
dvdrental=# select schemaname,relname from pg_stat_user_tables;
relnamespacefield points topg_namespace.oid, which contains the schemas