启动 postmaster
bash-3.00$ postmaster -D /var/lib/pgsql/data/mydata/
日志: 数据库上次关闭时间为 2011-02-10 12:05:10 CST
日志: checkpoint 记录位置在 0/33F248
日志: redo record is at 0/33F248; undo record is at 0/0; shutdown TRUE
日志: 下一个事物 ID: 565; 下一个 OID: 10794
日志: next MultiXactId: 1; next MultiXactOffset: 0
日志: 数据库系统准备就绪
日志: transaction ID wrap limit is 2147484146, limited by database "postgres"
4.初始化数据库
#su - postgres
$ln -s 9.0-pgdg pgsql
$cd pgsql/bin/64
$ ./initdb --encoding=utf8 -D $PGDATA
The files belonging to this database system will be owned by user "postgres".
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".
creating directory /export/home/postgres/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /export/home/postgres/data/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
loading PL/pgSQL server-side language ... 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 /export/home/postgres/data
or
./pg_ctl -D /export/home/postgres/data -l logfile start
cd /export/home/postgres/pgsql/bin/64
./pg_ctl -D $PGDATA -l $PGDATA/pg_log start