6.2 Installing PostgreSQL on Windows


Installing PostgreSQL on Microsoft Windows differs significantly from installing it on Unix. However, PostgreSQL can be run on Windows reliably and many people have chosen Windows as their default platform.

People using PostgreSQL on Windows usually use the binary distribution of PostgreSQL, which is included in Red Hat's Cygwin package. Cygwin is a product that provides a rich set of Unix tools for Windows users. One of these packages is PostgreSQL.

6.2.1 Installing the Cygwin Tools

To install Cygwin, check out http://sources.redhat.com/cygwin/ and click on Install Cygwin now to download a file called setup.exe. Start setup.exe and follow the instructions to install Cygwin. PostgreSQL is part of the Cygwin binary distribution and need not be installed manually.

Usually people install the binary distribution and don't install PostgreSQL from source because many platform-dependent questions have to be taken into consideration when compiling PostgreSQL on Windows machines.

6.2.2 Preparing Windows for PostgreSQL

The most important thing when working with Windows is to install the cygipc package. Because Windows does not provide a useful shared memory interface, this daemon is necessary; otherwise, there is no way to start the postmaster daemon.

After installing the cygipc package, the postmaster can be started on Windows just as you would start the postmaster on a Unix machine by using pg_ctl.

To download cygipc, check out http://www.neuro.gatech.edu/users/cwilson/cygutils/V1.1/cygipc/.

Do not use versions prior to 1.04; they will not work with PostgreSQL.

To install the shared memory daemon, unpack the source and follow the instructions in the README file.

In the next step you have to add the path of Cygwin's bin directory to the path on your system. Make sure that this directory is the first one in the list because of the sort command. Cygwin's sort.exe must be found before the sort.exe command provided by Windows.

On Windows versions based on NT technology (Windows NT, Windows 2000, Windows XP), the ipc daemon can be installed as a service. To start the service you can use:

 net start ipc-daemon 

On systems based on DOS technology such as Windows 95, Windows 98, or Windows Me, the following command must be used:

 ipc-daemon & 

6.2.3 Running PostgreSQL on Windows

After starting the cygipc daemon, PostgreSQL can be used just as on Unix machines.

The first thing you have to do is to create a database cluster. This can be done with the help of the createdb command. If no error has occurred, the postmaster daemon can be started using pg_ctl.



PHP and PostgreSQL. Advanced Web Programming2002
PHP and PostgreSQL. Advanced Web Programming2002
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 201

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net