インストーラなし PostgreSQL 起動手順 (マニュアル起動)

0)ソフトウェアのダウンロード
    postgresql-9.2.1-1-windows-x64-binaries.zip

1)dataディレクトリ(PGDATAディレクトリ)の作成
initdb -E UTF8 --no-locale -D C:\dev\kabu\pgdata



C:\dev\kabu\pgsql\bin>
C:\dev\kabu\pgsql\bin>initdb -E  --encoding=UTF8 --no-locale -D C:\dev\kabu\pgd
ta
The files belonging to this database system will be owned by user "doron".
This user must also own the server process.

The database cluster will be initialized with locale C.
initdb: "--encoding=UTF8" is not a valid server encoding name

C:\dev\kabu\pgsql\bin>initdb -E UTF8 --no-locale -D C:\dev\kabu\pgdata
The files belonging to this database system will be owned by user "doron".
This user must also own the server process.

The database cluster will be initialized with locale C.
The default text search configuration will be set to "english".

fixing permissions on existing directory C:/dev/kabu/pgdata ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers/max_fsm_pages ... 32MB/204800
creating configuration files ... ok
creating template1 database in C:/dev/kabu/pgdata/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

    "postgres" -D "C:/dev/kabu/pgdata"
or
    "pg_ctl" -D "C:/dev/kabu/pgdata" -l logfile start



2)データベース実行
pg_ctl start -D C:\dev\kabu\pgdata

3)データベースの作成
createdb yaoyorozu
4)確認
psqlの起動
psql yaoyorozu
yaoyorozu=# create table testtable(c1 int,c2 text);
CREATE TABLE
yaoyorozu=# \d
         List of relations
 Schema |   Name    | Type  | Owner
--------+-----------+-------+-------
 public | testtable | table | doron
(1 row)

yaoyorozu=# \d testtable
   Table "public.testtable"
 Column |  Type   | Modifiers
--------+---------+-----------
 c1     | integer |
 c2     | text    |

4)データベースの停止
pg_ctl stop -D C:\dev\kabu\pgdata