If you've altered your stock standard postgresql.conf configuration file of your Ubuntu server and upgraded to the lastest release, there is a good chance you'll get an error like:
FATAL: could not create shared memory segment: Invalid argument
DETAIL: Failed system call was shmget(key=5432001, size=72302592, 03600). If you get an error like that, it will be because your systems SHMMAX isn't set in sysctl . Its an easy fix, all you need to know is how big your SHMMAX needs to be. This issue is most likely related with the shared_buffers parameter of postgresql.conf - you systems shmmax needs to meet or exceed this limit, but DON'T GO OVER YOUR RAM LIMIT. SHMMAX defines you systems shared memory maximum. My shared_buffers is 512MB and I set my SHMMAX to 2GB because I have 2GB of RAM, though setting it to 1GB would have been fine. To find out if your system has a shmmax value set do:
sysctl -a | grep shmmaxyou should find something like kernel.shmmax=2147483648, if not, then this is probably why you can't start postgreSQL, simply set the value and start postgreSQL:
sudo sysctl -w kernel.shmmax=2147483648 #2GB in bytes
sudo /etc/init.d/postgresql-8.3 start
Hope all goes well ;)


This is the most
This is the most straightforward solution I could find to the problem. All the ubuntu guys are arguing that its an upstream problem, all the Postgres guys are arguing that its a distro/kernel problem. Arrrg!
Thanks!
Post new comment