| PostgreSQL 7.4.30 Documentation | ||||
|---|---|---|---|---|
| Prev | Fast Backward | Fast Forward | Next | |
This chapter describes the installation of PostgreSQL from the source code distribution.
./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.
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
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
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.