PostgreSQL with pgAdmin on Lion Server

I have to say I am a PostgreSQL fan when it comes to databases, mostly because that is what I am familiar with and what I started using first. I also tend to like softwares and services that are more to the open source side of things. But I was surprised to see that Mac OS X Lion Server came with PostgreSQL instead of MySQL unlike its predecessor Snow Leopard Server. Must be some licensing issue Apple had with Oracle I assume. But I will just provide a simple guide to help you get started using Postgres with pgAdmin. First step, open up the Server.app and turn on the web service.

Now download the latest version of pgAdmin and install.

The next step is to make sure postgres is listening for connection on localhost. For this open up terminal and open up /System/Library/LaunchDaemons/org.postgresql.postgres.plist for editing. Find listen_addresses and set it equal to 127.0.0.1.

If you are not sure how to do that, open up a new terminal, type in the following in order

cd ..
cd ..
sudo nano System/Library/LaunchDaemons/org.postgresql.postgres.plist

Find listen_addresses and make it listen_addresses=127.0.0.1

Now hit Ctrl+X and hit Y when asked to save.

Now restart postgres with the following commands

sudo serveradmin stop postgres
sudo serveradmin start postgres

Now go to the pgAdmin application downloaded earlier. It will ask you for a new server registration as shown below.

Use _postgres for username and the Administrator password as password.

Now you should have a pgAdmin successfully configured. You can use the PSQL console available under the menu for the rest of the work. All the documentation you will need are available here. Enjoy and let me know if you need any help.

2 thoughts on “PostgreSQL with pgAdmin on Lion Server

  1. click says:

    Is it fine to insert a portion of this on my weblog if I submit a reference point to this website?

Leave a Reply

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