Setting Up PostgreSQL
This section describes how to set up the PostgreSQL database with NetBeans 6.0
IDE.
To Set Up PostgreSQL
- Create a user by name postgres.
bash-3.2$ su
Password:
# chown postgres:postgres /var/postgres/8.2/data
# su - postgres
- Initialize the database.
bash-3.2$/usr/postgres/8.2/bin/initdb -D /var/postgres/8.2/data
The files belonging to this database system are owned by user postgres.
This user must also own the server process. The database cluster is
initialized with locale C.
- Start the database server.
bash-3.2$/usr/postgres/8.2/bin/postgres -D /var/postgres/8.2/data
or
bash 3.2$/usr/postgres/8.2/bin/pg_ctl -D /var/postgres/8.2/data -l logfile start
- Enable PostgreSQL version 8.2.
bash-3.2$ su
Password:
# /usr/sbin/svcadm enable postgresql:version_82
- Configure the PostgreSQL database with NetBeans IDE 6.0.
- Create a New Database Connection.
In the New Connection Database dialog box, enter the following details:
- Click the Advanced tab.
- Select a Database Schema to use.
- Create a Table.
- View the Table Data.