Text Size: Normal / Large

Chapter 14. Installation Instructions

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

14.1. Short Version

./configure
gmake
su
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.


User Comments


kwang <lim_kwang_hui AT yahoo.com>
06 Jan 2005 15:42:53

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
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

John <john AT wenzeldata.com>
13 Apr 2005 20:42:59

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

Michel <michel.jansen AT cs.utwente.nl>
11 Jul 2005 11:50:40

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.

Add Comment

Please use this form to add your own comments regarding your experience with particular features of PostgreSQL, clarifications of the documentation, or hints for other users. Please note, this is not a support forum, and your IP address will be logged. If you have a question or need help, please see the faq, try a mailing list, or join us on IRC. Note that submissions containing URLs or other keywords commonly found in 'spam' comments may be silently discarded. Please contact the webmaster if you think this is happening to you in error.

In order to submit a comment, you must have a community account.

* Comment
 

* denotes required field

Privacy Policy | Project hosted by hub.org | Designed by tinysofa
Copyright © 1996 – 2007 PostgreSQL Global Development Group