PostgreSQL中,如何查表属于哪个数据库

db1=# x
Expanded display is on.
db1=# SELECT * FROM information_schema.tables WHERE table_name='tab100';
-[ RECORD 1 ]----------------+-----------
table_catalog                | db1
table_schema                 | public
table_name                   | tab100
table_type                   | BASE TABLE
self_referencing_column_name | 
reference_generation         | 
user_defined_type_catalog    | 
user_defined_type_schema     | 
user_defined_type_name       | 
is_insertable_into           | YES
is_typed                     | NO
commit_action                | 

db1=# x
Expanded display is off.
db1=# 
原文地址:https://www.cnblogs.com/gaojian/p/3171261.html