■ Cygwin
ipc-daemon &
initdb -D /usr/local/pgsql/data -E UNICODE
※ PGDATA=/usr/local/pgsql/data としていても良い
pg_ctl start -D /usr/local/pgsql/data -l /usr/local/pgsql/log -o '-i'
createdb test
psql test < test.sql
■test.sql
create table account (
account_id serial not null primary key,
mdate timestamp not null,
txt varchar(255) not null,
money int not null
);
insert into account (mdate, txt, money) values (now(), 'BALANCE', 12000);
insert into account (mdate, txt, money) values (now(), 'from previous', 10000);
insert into account (mdate, txt, money) values (now(), 'salary', 5000);
insert into account (mdate, txt, money) values (now(), 'by card', -3000);
***
Success. You can now start the database server using:
/usr/bin/postmaster -D /usr/local/pgsql/data
or
/usr/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
***
/usr/bin/pg_ctl stop -D /usr/local/pgsql/data -m immediate