PostgreSQL Configuration

PostgreSQL Server

For detailed installation instructions, see the Red Hat Database Getting Started / Installation Guide online at:

http://www.redhat.com/docs/manuals/database/RHDB-2.0-Manual/install/install.html

When you start the database, you must use the -i option to allow clients to connect via TCP/IP.

postmaster -i > logfile 2>&1 &

To stop the database, you can use pg_ctl. For instance, you can use:

pg_ctl stop -m immediate

Creating the Database

Creating the database is straight forward. There are only two items that must be done. First, you need to declare that the database should encode information in the UNICODE setting. For more information, refer to:

http://www.redhat.com/docs/manuals/database/RHDB-7.1-Manual/admin_user/multibyte.html

Second, you must enable plpgsql for the database.

To create the database, you can execute the following:

createdb -h hostname -E UNICODE dbname
createlang -h hostname plpgsql dbname

Where hostname is the name of the host on which the database is running and dbname is the name of the database you want to create.

If you need to load the database by hand, you can do it via the command line with the following command:

psql -h hostname dbname < postgres-create.sql

NoteNote
 

You can add UNICODE support for every database if you use the -E option when running initdb. For instance, you can use initdb -E UNICODE.

You can add PL/PGSQL support to all databases by adding it to template1, and then by executing the following line before creating the first database createlang plpgsql template1.

PostgreSQL Client

The PostgreSQL JDBC driver must be in your CLASSPATH.