「PostgreSQL」情報スキーマ情報を取得するサンプル

環境
Windows 10 home 64bit
Postgresql 9.6.5

使用例
1.トリガー一覧を取得します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# select * from information_schema.triggers;
postgres=# select * from information_schema.triggers;
postgres=# select * from information_schema.triggers;

2.ビュー一覧を取得します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# select * from information_schema.views;
postgres=# select * from information_schema.views;
postgres=# select * from information_schema.views;

3.テーブル一覧を取得します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# select * from information_schema.tables;
postgres=# select * from information_schema.tables;
postgres=# select * from information_schema.tables;

4.スキーマ一覧を取得します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# select * from information_schema.schemata;
postgres=# select * from information_schema.schemata;
postgres=# select * from information_schema.schemata;

 

PostgreSQL

Posted by arkgame