「PostgreSQL」テーブル一覧を確認する方法
1.テーブルを確認
postgres=# \dt
リレーションの一覧
スキーマ | 名前 | 型 | 所有者
----------+------+----------+----------
public | empp | テーブル | postgres
(1 行)
postgres=# \dt
リレーションの一覧
スキーマ | 名前 | 型 | 所有者
----------+------+----------+----------
public | empp | テーブル | postgres
(1 行)
postgres=# \dt リレーションの一覧 スキーマ | 名前 | 型 | 所有者 ----------+------+----------+---------- public | empp | テーブル | postgres (1 行)
2.システムカタログpg_tablesを確認
postgres=# select schemaname,tablename,tableowner from pg_tables;
schemaname | tablename | tableowner
--------------------+-------------------------+------------
cfschema | usetbl | postgres
public | empp | postgres
postgres=# select schemaname,tablename,tableowner from pg_tables;
schemaname | tablename | tableowner
--------------------+-------------------------+------------
cfschema | usetbl | postgres
public | empp | postgres
postgres=# select schemaname,tablename,tableowner from pg_tables; schemaname | tablename | tableowner --------------------+-------------------------+------------ cfschema | usetbl | postgres public | empp | postgres