PostgreSQL version: 8.3
By default, the PostgreSQL database files is located at /var/lib/pgsql/data. Initialize the database can be done by the following command.
- service postgresql initdb
So what about if i want to initialize the database at another location?
Here are the steps.
1. Login as/Switch to postgres
2. Initialize the database
- initdb -D /home/ykyuen/data
4. Edit the postgresql startup script
- vi /etc/rc.d/init.d/postgresql
5. Start the database
- /etc/init.d/postgresql start
Done =)