2004-10-16 00:18:35 +08:00
|
|
|
Installing PostgreSQL on Windows Using Cygwin FAQ
|
|
|
|
=================================================
|
2000-09-27 23:17:57 +08:00
|
|
|
|
2007-10-09 09:28:24 +08:00
|
|
|
$Date: 2007/10/09 01:28:24 $
|
2003-11-12 12:14:30 +08:00
|
|
|
|
2003-11-29 04:22:18 +08:00
|
|
|
PostgreSQL requires the appropriate subset of Cygwin DLLs to be
|
2003-11-12 12:14:30 +08:00
|
|
|
installed in order that it functions under Windows.
|
2001-12-06 02:23:40 +08:00
|
|
|
|
2003-11-09 11:47:51 +08: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-06 02:23:40 +08:00
|
|
|
|
2003-11-09 11:47:51 +08: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 06:54:07 +08:00
|
|
|
|
2003-11-09 11:47:51 +08:00
|
|
|
2. Proceed through the Cygwin install wizard. Choose 'Install from
|
|
|
|
Internet', specify a Local Package Directory and choose a mirror
|
2003-11-12 12:14:30 +08:00
|
|
|
site that's close to you. Answer the other installer questions
|
2003-11-29 04:22:18 +08:00
|
|
|
appropriately for your configuration.
|
2001-12-06 02:23:40 +08:00
|
|
|
|
2003-11-09 11:47:51 +08: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-06 02:23:40 +08:00
|
|
|
|
2003-11-09 11:47:51 +08:00
|
|
|
3. Once the download and install process is complete, open a Cygwin
|
2003-11-12 12:14:30 +08:00
|
|
|
shell and do the following for a basic installation:
|
2001-12-06 02:23:40 +08:00
|
|
|
|
2004-07-21 06:56:40 +08:00
|
|
|
3a. Start cygserver for shared memory support. To do this,
|
|
|
|
enter the command "/usr/sbin/cygserver &". This program
|
2007-10-09 09:28:24 +08:00
|
|
|
needs to be running anytime you start the Postgres server
|
|
|
|
or initialize a database (initdb).
|
2001-01-23 06:54:07 +08:00
|
|
|
|
2003-11-09 11:47:51 +08:00
|
|
|
3b. Use the initdb command to create a new database cluster. An
|
|
|
|
example command would be:
|
2001-12-06 02:23:40 +08:00
|
|
|
|
2003-11-29 04:22:18 +08:00
|
|
|
initdb -D /usr/local/pgsql/data -W -E LATIN1
|
2003-11-09 11:47:51 +08: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.
|
|
|
|
|
2007-10-09 09:28:24 +08:00
|
|
|
3c. Start up the Postgres server. Use a command similar to the
|
2003-11-09 11:47:51 +08:00
|
|
|
following:
|
|
|
|
|
2007-10-09 09:28:24 +08:00
|
|
|
postgres -D /usr/local/pgsql/data
|
2003-11-09 11:47:51 +08:00
|
|
|
|
2007-10-09 09:28:24 +08:00
|
|
|
This will start the server, and if successful you will
|
2003-11-09 11:47:51 +08:00
|
|
|
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.
|
|
|
|
|
2007-10-09 09:28:24 +08:00
|
|
|
5. It is possible to install cygserver and the Postgres server as
|
2003-11-12 12:14:30 +08:00
|
|
|
Windows NT services. For information on how to do this, please
|
2003-11-13 11:53:00 +08:00
|
|
|
refer to the README document included with Cygwin PostgreSQL. It
|
|
|
|
is installed in the /usr/share/doc/Cygwin directory.
|
2003-11-12 12:14:30 +08:00
|
|
|
|
2003-11-09 11:47:51 +08: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 12:14:30 +08:00
|
|
|
utilities. This will help prevent problems with compilation.
|
2003-11-09 11:47:51 +08:00
|
|
|
|
|
|
|
2. Proceed according to the INSTALL file (i.e., ./configure; make; etc.)
|
2001-12-06 02:23:40 +08: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 06:54:07 +08:00
|
|
|
|
2001-12-06 02:23:40 +08:00
|
|
|
Alternatively, proceed according to the README file supplied with
|
|
|
|
the Cygwin PostgreSQL package.
|
2001-01-23 06:54:07 +08:00
|
|
|
|
2003-11-09 11:47:51 +08:00
|
|
|
Known issues
|
|
|
|
------------
|
2001-01-23 06:54:07 +08:00
|
|
|
|
2001-04-04 02:14:39 +08:00
|
|
|
1. Cygwin's AF_UNIX sockets are really implemented as AF_INET sockets
|
2001-01-23 06:54:07 +08:00
|
|
|
so they are inherently insecure.
|
|
|
|
|
2003-11-09 11:47:51 +08:00
|
|
|
2. "make check" can generate spurious regression test failures due to
|
2001-04-25 04:05:02 +08:00
|
|
|
overflowing the listen() backlog queue which causes connection
|
2003-11-29 04:22:18 +08:00
|
|
|
refused errors or hangs. You can limit the number of connections
|
2003-11-09 11:47:51 +08: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-04 02:14:39 +08:00
|
|
|
|
2004-07-21 06:56:40 +08: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-26 00:20:51 +08:00
|
|
|
Problem reports can be sent to pgsql-cygwin@postgresql.org.
|