PostgreSQLで作成されているテーブルの一覧を取得する方法

データベースPostgreSQL

記事内に広告が含まれています。

PostgreSQL でテーブルの一覧を取得するにはシステムカタログの pg_tables を使用します。

スポンサーリンク

PostgreSQLのテーブル一覧

PostgreSQL のテーブル一覧はシステムカタログの pg_tables を検索すると取得できます。

SELECT schemaname, tablename from pg_tables

実行結果(長いので一部省略)は以下になります。

schemaname tablename tableowner
pg_catalog pg_statistic postgres
pg_catalog pg_type postgres
public master_post system-trust
public master_user system-trust
pg_catalog pg_authid postgres
pg_catalog pg_user_mapping postgres
pg_catalog pg_attribute postgres
pg_catalog pg_proc postgres
システムトラストでは一緒に働いていただける仲間を募集中です。
記事内に広告が含まれています。
株式会社システムトラスト

システムトラストでは、システムエンジニア、プログラマーなどを随時募集中です。気軽にご相談ください。

お問合せ