perldiver (perldiver) wrote,

  • Mood:

Building PostgreSQL on Mac OS X

This page explains it really well:

Short form:

  1. Install Fink (you're going to want Fink and probably FinkCommander anyway, if you are a developer)
  2. sudo  /sw/bin/fink install readline
  3. Download and unzip the latest tarball of the Postrgres code from (or another mirror)
  4. Configure with the options of your choice.  These were my choices:
    1. ./configure --with-includes=/sw/include/ --with-libraries=/sw/lib --with-perl --with-python --with-bonjour --enable-thread-safety
  5. Build
    1. make
    2. make install
Ta-da, you're done!  Pg is now built on your OSX machine and ready to be initialized. 

For completeness, here's the initialization procedure as well:
  1. Create a postgres user
  2. sudo bash
  3. mkdir -p /usr/local/pgsql/data
  4. chown -R postgres /usr/local/pgsql/data
  5. su postgres
  6. /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
  7. /usr/local/pgsql/bin/psql
  8. CREATE USER your_user_name WITH PASSWORD 'fooBar';
  9. CREATE DATABASE your_user_name;
That's it.  You may want to add some or all of the following to a .profile, .bashrc, or other file that gets run at login, just to save yourself some typing or make link files available, but it shouldn't be strictly necessary: 

export LD_LIBRARY_PATH=/usr/local/pgsql/lib
export MANPATH=/usr/local/pgsql/man:$MANPATH
export PATH=/usr/local/pgsql/bin:$PATH
Tags: computer, database, geek, install, postgres, software
  • Post a new comment


    default userpic