Installing PostgreSQL 7 on GNU/Linux and FreeBSD, Page 2
ConfigureChange to the SRC directory (cd ~/postgresql-7.0.2/src) under the postgresql-7.0.2 directory created when you unpacked the source. To start the configure, process simply type ./configure at the prompt. You will see several screens worth of text scroll by as the configure script examines your system.
Configure does a lot of checking and may take a while to run through to completion. On System A the configure process took 177 seconds to run, while System B churned through in 33 seconds.
There are a number of command line options that can be given to the configure script which will change defaults and other options used to build pgsql. A few important arguments are listed below:
- --prefix=<directory> -- Determines where the resulting binaries will be installed. The default prefix is /usr/local/pgsql.
- --with-pgport=<port number> -- Tells pgsql which TCP/IP port it should use when chatting with client applications. The default port is 5432.
- --with-maxbackends=<number of backends> -- The default number of back ends is set to 32 in file include/config.h. If you're going to have a large user population, you'll want to increase this value upwards. A good place to start is to multiply the number of users by two.. If you find this is still too low, rebuild pgsql with a higher number of back ends. As you look at include/config.h, you will see a comment discussing the affects of setting this parameter to a higher value.
There are hosts of other configure options that may pertain to your production installation, but for the time being stick to the defaults. We want to get pgsql up and running quickly.
If configure finds something with your system that will prevent pgsql from compiling, it will alert you and abort. For instance, configure will look for a C++ compiler on your system and abort if it cannot find one. If configure aborts, read the message, fix the problem, and rerun configure.
MakeAt this point we have the build system configured to compile pgsql. While it's still in the SRC directory type make (or gmake), go grab a cup of coffee--depending on the type of machine you have this, step can take quite a while.
On System A the compile took almost 46 minutes, while System B performed the build in just over 5 minutes.
As with the configure script there are a number of command line options you can specify to modify how the pgsql source is compiled. For the purposes of getting pgsql up and running with the least amount of pain, we will skip over these options.
If the compile process runs into a situation it can't handle it will abort with error messages. If this occurs, you can try to fix the problem yourself or go search the mailing list archives at the PostgreSQL web site. If you don't find a solution searching the archives, it's time to subscribe to one of the mailing lists and post a question asking for help.