MacにPostgreSQLをソースからインストール
configureでパスを指定してインストール(足りないものがあれば適宜brew)
他のUNIXならだいたい同じかと
./configure --prefix=/Users/user/Desktop/postgresinstall make make install
initdbを実行してからpostgresを起動
cd /Users/user/Desktop/postgresinstall/bin ./initdb -D /Users/user/Desktop/postgresrun/ --encoding=UTF8 --no-locale ./postgres -D /Users/user/Desktop/postgresrun -p 5555
起動できていたら別のターミナルから接続
./psql -p 5555 -d template1 \q
ユーザー作成と一覧
CREATE ROLE hoge LOGIN PASSWORD 'password'; \du
DB作成とDB選択
CREATE DATABASE testdb; \c testdb
テーブル作成
create table testtable (hogehoge char(10)); insert into testtable (hogehoge) values('test1'); select * from testtable;