This is an old revision of the document!
Installing PostgreSQL 8.2 from source on Debian or Ubuntu
Some distributions, such as Debian Etch, do not offer packages for PostgreSQL 8.2—but Evergreen 1.4 requires PostgreSQL 8.2. Following is a rough set of instructions for installing PostgreSQL 8.2 from source on a Debian or Ubuntu system as a stow
-managed application.
NOTE: These instructions are also available in the Evergreen documentation at http://docs.evergreen-ils.org/1.6/draft/html/InstallingPostgreSQL.html. In github: http://github.com/rsoulliere/Evergreen-DocBook/blob/master/1.6/admin/AdminMisc.xml.
- If you have not yet installed
stow
on your system, install it. Issue the following command as the root user:aptitude install stow
- Download, compile, and install the latest bugfix release for PostgreSQL 8.2 (8.2.12 at the time this was written):
wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.2.12/postgresql-8.2.12.tar.bz2 tar xjf postgresql-8.2.12.tar.bz2 cd postgresql-8.2.12 ./configure --with-perl --enable-integer-datetimes --with-openssl --prefix=/usr/local/stow/pgsql && make make install cd contrib && make make install cd xml2 && make make install cd /usr/local/stow stow pgsql # if there was a conflict, you can move the offending directory out of the way: mv /usr/local/man /usr/local/man.bak # then try again stow pgsql
- Create a new user,
postgres
, to run the PostgreSQL processes:adduser postgres
- Initialize the database directory and start up PostgreSQL:
mkdir -p /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres initdb -D /usr/local/pgsql/data -E UNICODE --locale=C pg_ctl -D /usr/local/pgsql/data -l /home/postgres/logfile start
Config stuff to change
echo 7000000000 > /proc/sys/kernel/shmmax
default stats target (from 10 to 100)
work mem (from 4m to something higher… 128M?)
Shared buffers (to 512M for a 2G machine)
Effective cache size
(11:41:49 AM) dmcmorris_esi: miker_: stats target , workmem, shared buffers for 32GB Mem (11:42:34 AM) miker_: stats target = 100 (always), work mem = 128M, shared buffers = 4G (11:42:51 AM) miker_: effective cache size = 24G
Vaccuum full analyze verbose