0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【PostgreSQL】テーブルコメント(論理名)を取得する簡単なコマンド

Posted at

テーブルコメント(論理名)を表示したい!

テーブルコメントに論理名が登録されていることがあります。
ex) 物理名にstore、論理名に店舗マスタが書かれている

DBで\d+すれば全てのテーブルが出てきますが、指定したものだけ出したい場合はどうするか。
\d+ table名してもカラムコメントしか出てこない…)

また、以下のサイトのようにSQLで実行する場合はチョットナガイ。
PostgreSQL/テーブル一覧およびテーブルコメントを表示する

表示方法

DBに入らずターミナル上で下記psqlコマンドを打ち込むとテーブルコメントを確認する事ができます。
※table名は基本小文字。

$ psql -c '\d+' database名 | grep table名

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?