PostgreSQL crashes upon startup

postgresql

Every time I restart my Mac OS X Version 10.8.3. and open PSQL Version 9.2.4.3 (14), the PSQL terminal appears for a second and then shuts down.

Below is the info from the docs http://postgresapp.com/documentation

Uninstalling

What I do to remedy the problem is type these 3 lines of code in bash:
open ~/Library/Application\ Support/Postgres –> I delete the Var folder
sudo sysctl -w kern.sysv.shmall=65536
sudo sysctl -w kern.sysv.shmmax=16777216

When I restart PSQL, it works. The problem I have an empty database. All my work is gone.
How can I get PSQL running permantely so that I do not have to restart with an empty database?

Best Answer

Put those values in /etc/sysctl.conf and they will be read on boot

Mine is:

[codyc:~]$ cat /etc/sysctl.conf
kern.sysv.shmmax=1073741824
kern.sysv.shmall=1073741824