PostgreSQLでテーブル一覧とテーブル定義を表示する

テーブル一覧の表示

\dt;

            List of relations
  Schema   |  Name   | Type  |   Owner   
-----------+---------+-------+-----------
 java_user | uketuke | table | java_user
(1 row)

テーブル定義の表示

\d テーブル名;

Column    |            Type             | Collation | Nullable |                 Default                 
-------------+-----------------------------+-----------+----------+--- 
--------------------------------------
 uke_no      | integer                     |           | not null | 
nextval('uketuke_uke_no_seq'::regclass)
 sei_name    | character varying(100)      |           |          | 
 mei_name    | character varying(100)      |           |          | 
 nk_add      | character varying(13)       |           |          | 
 nm_add1     | character varying(200)      |           |          | 
 nm_add2     | character varying(200)      |           |          | 
 nm_add3     | character varying(200)      |           |          | 
 nk_tel      | character varying(15)       |           |          | 
 gender_no   | character varying(2)        |           |          | 
 birthday_dt | timestamp without time zone |           |          | 
 nk_mail     | character varying(300)      |           |          | 
 nk_pass     | character varying(50)       |           |          | 
Indexes:
    "uketuke_pkey" PRIMARY KEY, btree (uke_no)

参考URL

(PostgreSQL) テーブル情報を取得するSQL 等

PostgreSQLの基本的なコマンド