Mac PostgreSQL

It’s nice to see that PostgreSQL has a Mac installer now.

PostgreSQL adjusts the shared memory settings before the install. Fortunately they tell you what changed. I’m not sure what the side effects of increasing shared memory from default 4MB to 32MB is. Probably nothing. I renamed /etc/sysctl.conf to sysctl.conf.postgres and rebooted to undo these changes anyway.

I opted to adjust the postgres configuration instead.

Changing max_connections from 100 to 5 and shared_buffers from 24MB to 128kB allows the database to start. This seems to work fine for my development database.

PostgreSQL needed to be added to the system path.

# ~/.bash_profile
export PATH

I installed PostgreSQL on a fresh install of Leopard. It turns out that you need the apple development tools installed before installing PostgreSQL or the command line tools don’t work.

dyld: Library not loaded: /Users/buildfarm/pginstaller/server/staging/osx/lib/libpq.5.dylib

This error can be fixed installing the development tools first and then reinstalling PostgreSQL. It looks like the installer uses otool to rewrite the path to the library.

The installer sets PostgreSQL to start automatically when the system boots. This is really annoying especially since I don’t know how to stop it. I can disable the startup item.

$ cd /Library/StartupItems/postgresql-8.3/
$ sudo touch .disabled

But this isn’t a good solution since the Start Server and Stop Server “applications” don’t work when the service is disabled. Grrrr. I’m guessing they’re using something like “sudo SystemStarter start postgresql-8.3”. Is there some way to set a StartupItem to manual?

Posted in mac, postgresql
4 comments on “Mac PostgreSQL
  1. hardy says:

    Have you found a way to manually start/stop postgres? I would like to do the same thing.

  2. eric says:

    First… there has been a mac installer for postgresql for mac ( even before enterpriseDb came into the picture.

    Second… I think the “original” postgresql for mac by andy satori (agai, is still better.

    I’ve tried using EnterpriseDB’s package and it seems it still is getting through some birth pains, issues you report above have been resolved before.

  3. digitalgeo says:

    Have you tried start/stopping from in pdAdmin ?

  4. Jason Stapley says:

    sudo -u postgres /Library/PostgreSQL/9.1/bin/pg_ctl stop -D /Library/PostgreSQL/9.1/data -m f

    This will stop postgresql if you installed it in the default location on OSX. I read the manual to find out how to do this. The blog had some useful information in it.

    I tried start stopping in pdAdmin but could not find the option…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: