Shared memory fix for PostgreSQL Mac installation

EnterpriseDB have kindly created a one-click installer for PostgreSQL, but unfortunately it doesn't work out-of-the-box, at least not on my MacBook Pro. The problem is down to the amount of shared memory that is configured in OS X; by default it is 4Mb, and PostgreSQL requires 32Mb:

Postgres installer error

The error message suggests looking at the README file, which actually doesn't exist. Luckily, there's a simple fix; to increase the shared memory to the required 32Mb, create or edit the /etc/sysctl.conf file and include the following lines:

kern.sysv.shmall=8192
kern.sysv.shmseg=64
kern.sysv.shmmni=256
kern.sysv.shmmin=1
kern.sysv.shmmax=33554432

Reboot your machine for the settings to take effect, and re-launch the PostgreSQL installer which should now work as normal.

Comments

  1. Avin Tokade says:

    Thanks for the info.

    I am getting same above error. But I worried to edit in kernel file.

    Is this safe modify kernel parameter ?

    My MacBook has 4 gb Ram.

  2. Glen says:

    Hey Avin,

    I didn't have any problems after making these edits, but it goes without saying: before editing make sure you make a backup copy of the configuration file.

  3. Avin Tokade says:

    Hello Glen,

    Sorry, I forgot to inform you. I have successfully installed PostgreSQL on my Mac Book with above setting.

    who don't want to restart after modifying sysctl.conf. Just run 'sysctl -p' to load new sysctl setting.

    Thanks again for the help.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>