This page in other versions: 9.0 / 9.1 / 9.2 / 9.3 / 9.4  |  Development versions: devel  |  Unsupported versions: 7.1 / 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2 / 8.3 / 8.4

Chapter 14. Installation Instructions

This chapter describes the installation of PostgreSQL from the source code distribution.

14.1. Short Version

gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

The long version is the rest of this chapter.


Jan. 6, 2005, 3:42 p.m.

On Debian Systems, the "short version" of the setup above should use the following, including the different directories.

to install the package
apt-get update
apt-get install postgresql

initialize the database system
su - postgres
/usr/lib/postgresql/bin/initdb -D /var/lib/postgres/data
/etc/init.d/postgresql start

that's it. once running, you can use it, e.g.
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

April 13, 2005, 8:42 p.m.

If you are installing on Mac OSX Server (I have 10.2.8) the following may help:

use "gnumake" instead of "gmake"
use "gnumake install" instead of "gmake install"
instead of "adduser postgres", create the new user as you would normally

Hope this helps someone

July 11, 2005, 11:50 a.m.

When installing on Mac OS X, if you encounter an error such as:

FATAL: could not create shared memory segment: Cannot allocate memory
DETAIL: Failed system call was shmget(key=1, size=1081344, 03600).
HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. To reduce the request size (currently 1081344 bytes), reduce PostgreSQL's shared_buffers parameter (currently 50) and/or its max_connections parameter
(currently 10).
The PostgreSQL documentation contains more information about shared memory configuration.

It might help to increase the shm limit.

To do this, you need to edit the file /etc/rc and search for a line where "kern.sysv.shmmax" is set using sysctl, and change the value there to a larger one and reboot.

Here, I increased the value to 20MB (20971520) and it seems to work fine.

Note that it should be possible to update the kern.sysv.shmmax without rebooting. Check the sysctl manpage for details.

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group