2004-10-15 20:18:35 +04:00
|
|
|
Installing PostgreSQL on Windows Using Cygwin FAQ
|
|
|
|
=================================================
|
2000-09-27 19:17:57 +04:00
|
|
|
|
2004-10-15 20:18:35 +04:00
|
|
|
$Date: 2004/10/15 16:18:35 $
|
2003-11-12 07:14:30 +03:00
|
|
|
|
2003-11-28 23:22:18 +03:00
|
|
|
PostgreSQL requires the appropriate subset of Cygwin DLLs to be
|
2003-11-12 07:14:30 +03:00
|
|
|
installed in order that it functions under Windows.
|
2001-12-05 21:23:40 +03:00
|
|
|
|
2003-11-09 06:47:51 +03:00
|
|
|
This document assumes that you do not have Cygwin already installed
|
|
|
|
on your system. If that is not the case, then you will need to
|
|
|
|
adjust these instructions accordingly.
|
2001-12-05 21:23:40 +03:00
|
|
|
|
2003-11-09 06:47:51 +03:00
|
|
|
1. Download and run the Cygwin installer. Visit http://cygwin.com/ and
|
|
|
|
click on the "Install Cygwin now' link. This will prompt you
|
|
|
|
to download a "setup.exe". Save this file somewhere on your
|
|
|
|
system and then execute it.
|
2001-01-23 01:54:07 +03:00
|
|
|
|
2003-11-09 06:47:51 +03:00
|
|
|
2. Proceed through the Cygwin install wizard. Choose 'Install from
|
|
|
|
Internet', specify a Local Package Directory and choose a mirror
|
2003-11-12 07:14:30 +03:00
|
|
|
site that's close to you. Answer the other installer questions
|
2003-11-28 23:22:18 +03:00
|
|
|
appropriately for your configuration.
|
2001-12-05 21:23:40 +03:00
|
|
|
|
2003-11-09 06:47:51 +03:00
|
|
|
When you come to the point of choosing which packages to install,
|
|
|
|
expand the 'Database' section and click 'Skip' next to PostgreSQL
|
|
|
|
to change it to the latest version of PostgreSQL available for
|
|
|
|
Cygwin.
|
2001-12-05 21:23:40 +03:00
|
|
|
|
2003-11-09 06:47:51 +03:00
|
|
|
3. Once the download and install process is complete, open a Cygwin
|
2003-11-12 07:14:30 +03:00
|
|
|
shell and do the following for a basic installation:
|
2001-12-05 21:23:40 +03:00
|
|
|
|
2004-07-21 02:56:40 +04:00
|
|
|
3a. Start cygserver for shared memory support. To do this,
|
|
|
|
enter the command "/usr/sbin/cygserver &". This program
|
2003-11-28 23:22:18 +03:00
|
|
|
needs to be running anytime you start the PostgreSQL server
|
2003-11-09 06:47:51 +03:00
|
|
|
(postmaster) or initialize a database (initdb).
|
2001-01-23 01:54:07 +03:00
|
|
|
|
2003-11-09 06:47:51 +03:00
|
|
|
3b. Use the initdb command to create a new database cluster. An
|
|
|
|
example command would be:
|
2001-12-05 21:23:40 +03:00
|
|
|
|
2003-11-28 23:22:18 +03:00
|
|
|
initdb -D /usr/local/pgsql/data -W -E LATIN1
|
2003-11-09 06:47:51 +03:00
|
|
|
|
|
|
|
Which will create a cluster in the /usr/local/pgsql/data
|
|
|
|
directory, will prompt for a superuser password and will
|
|
|
|
set the default database encoding to LATIN1.
|
|
|
|
|
|
|
|
3c. Start up the postmaster. Use a command similar to the
|
|
|
|
following:
|
|
|
|
|
2003-11-28 23:22:18 +03:00
|
|
|
postmaster -D /usr/local/pgsql/data
|
2003-11-09 06:47:51 +03:00
|
|
|
|
|
|
|
This will start the postmaster, and if successful you will
|
|
|
|
see some initial log entries, and an entry "LOG: database
|
|
|
|
system is ready".
|
|
|
|
|
|
|
|
4. You are now running a PostgreSQL server on your Windows machine.
|
|
|
|
|
2004-07-21 02:56:40 +04:00
|
|
|
5. It is possible to install cygserver and the postmaster as
|
2003-11-12 07:14:30 +03:00
|
|
|
Windows NT services. For information on how to do this, please
|
2003-11-13 06:53:00 +03:00
|
|
|
refer to the README document included with Cygwin PostgreSQL. It
|
|
|
|
is installed in the /usr/share/doc/Cygwin directory.
|
2003-11-12 07:14:30 +03:00
|
|
|
|
2003-11-09 06:47:51 +03:00
|
|
|
Building from source
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
There are some points that are only relevant if you are building Cygwin
|
|
|
|
PostgreSQL from source:
|
|
|
|
|
|
|
|
1. Set your path to use the Cygwin bin directory before the Windows
|
2003-11-12 07:14:30 +03:00
|
|
|
utilities. This will help prevent problems with compilation.
|
2003-11-09 06:47:51 +03:00
|
|
|
|
|
|
|
2. Proceed according to the INSTALL file (i.e., ./configure; make; etc.)
|
2001-12-05 21:23:40 +03:00
|
|
|
noting the following Cygwin specific differences:
|
|
|
|
|
|
|
|
o The GNU make command is called "make" not "gmake".
|
|
|
|
o The adduser command is not supported -- use the appropriate
|
|
|
|
user management application on Windows NT, 2000, or XP.
|
|
|
|
Otherwise, skip this step.
|
|
|
|
o The su command is not supported -- use ssh to simulate su
|
|
|
|
on Windows NT, 2000, or XP. Otherwise, skip this step.
|
2001-01-23 01:54:07 +03:00
|
|
|
|
2001-12-05 21:23:40 +03:00
|
|
|
Alternatively, proceed according to the README file supplied with
|
|
|
|
the Cygwin PostgreSQL package.
|
2001-01-23 01:54:07 +03:00
|
|
|
|
2003-11-09 06:47:51 +03:00
|
|
|
Known issues
|
|
|
|
------------
|
2001-01-23 01:54:07 +03:00
|
|
|
|
2001-04-03 22:14:39 +04:00
|
|
|
1. Cygwin's AF_UNIX sockets are really implemented as AF_INET sockets
|
2001-01-23 01:54:07 +03:00
|
|
|
so they are inherently insecure.
|
|
|
|
|
2003-11-09 06:47:51 +03:00
|
|
|
2. "make check" can generate spurious regression test failures due to
|
2001-04-25 00:05:02 +04:00
|
|
|
overflowing the listen() backlog queue which causes connection
|
2003-11-28 23:22:18 +03:00
|
|
|
refused errors or hangs. You can limit the number of connections
|
2003-11-09 06:47:51 +03:00
|
|
|
using the MAX_CONNECTIONS option thus:
|
|
|
|
|
|
|
|
make MAX_CONNECTIONS=5 check
|
|
|
|
|
|
|
|
(On some systems you can have up to about 10 simultaneous connections).
|
2001-04-03 22:14:39 +04:00
|
|
|
|
2004-07-21 02:56:40 +04:00
|
|
|
3. The default cygserver configuration may need to be changed (e.g.,
|
|
|
|
increase SEMMNS) to prevent PostgreSQL from failing due to a lack of
|
|
|
|
system resources.
|
|
|
|
|
2001-10-25 20:20:51 +04:00
|
|
|
Problem reports can be sent to pgsql-cygwin@postgresql.org.
|