I'm pretty new to postgres and I know that a \dt
will show up the tables, `dtIs` will show tables and indexes but I'm looking for how to show/find hidden tables if any?
Asked
Active
Viewed 5,002 times
2

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

skywalka
- 21
- 1
- 2
1 Answers
3
To find tables in any schema of a database, you could check the catalog table pg_class
SELECT oid::regclass AS table_name
FROM pg_class
WHERE relname = 'my_table_name'
AND relkind = 'r';
Note, this includes "invisible" tables, that are not in your search_path
, and even temporary tables from other sessions that you cannot access at all. There are no other "hidden" tables.
Tables in other databases of the same cluster are not included.

Community
- 1
- 1

Erwin Brandstetter
- 605,456
- 145
- 1,078
- 1,228