PostgreSQL でユーザとデータベースの作成

$ psql -U postgres -d postgres

postgres=> 

-- DATABASE一覧の表示
postgres=> \l

-- ユーザーの一覧を表示
postgres=> \dg

-- DATABASE作成
postgres=> CREATE DATABASE newdb OWNER postgres;

-- Userの作成
postgres=> CREATE USER newuser WITH PASSWORD 'password';

-- DATABASE、Userの削除
postgres=> DROP DATABASE newdb;
postgres=> DROP USER newuser;

-- psqlから出る
postgres=> \q

$