postgresql install

sudo apt-get install postgresql
sudo apt-get install libpq-dev

postgresql settings

sudo su postgres -c psql
postgres=# CREATE ROLE [user] SUPERUSER LOGIN;
postgres=# \password [user]
  [userpassword]
  [userpassword]

check or list database, tables, indexes, and so on.

postgres=# create database [user];
postgres=# select * from pg_user; /* ユーザ一覧 */
postgres=# \d /* 表、インデックスの一覧 */
postgres=# \dt /* 表の一覧 */
postgres=# \d [表名] /* 表の項目一覧 */
postgres=# \l /* データベース一覧、文字コード表示 */
postgres=# \q /* 終了 */
psql -l # データベース 一覧
psql [データベース名] # psql へ切り替え