
% sudo -u postgres /usr/local/pgsql84/bin/pg_ctl -D /usr/local/pgsql84/data startīy this point the server should be running, and you can add /usr/local/pgsql84/bin to your path, % sudo -u postgres /usr/local/pgsql84/bin/initdb -D /usr/local/pgsql84/data (The incantation in the fourth line is finding the next available userid to assign to the postgres user)Ĭreate the database cluster and start the server: create /Users/postgres NFSHomeDirectory /usr/local/pgsql84 list /Users UniqueID | awk '' | sort -n | tail -1` create /Users/postgres RealName Postgresql create /Users/postgres UserShell /bin/bash User to own the database is a little trickier than on other unixes. This works pretty much like installing postgresql on any other platform, but creating the postgres You can delete the /usr/local/pgsql84-i386 temporary installation dylib files - you want to lipo together the real files, and leave the symlinks untouched.Īt this point postgresql is built. You'll need to choose the right filenames for the. /pgsql84-i386/libpqtypes.3.1.dylib original/libpqtypes.3.1.dylib -output libpqtypes.3.1.dylib /pgsql84-i386/libpqtypes.a original/libpqtypes.a -output libpqtypes.a /pgsql84-i386/libpq.a original/libpq.a -output libpq.a % sudo mv libpq.a libpq.5.2.dylib libpqtypes.a libpqtypes.3.1.dylib original configure -prefix=/usr/local/pgsql84-i386 -with-openssl -with-libs=/usr/local/lib -with-includes=/usr/local/include You may want different configure flags - see "./configure -help" for a list of them. configure -prefix=/usr/local/pgsql84 -with-openssl -with-libs=/usr/local/lib -with-includes=/usr/local/include Need to run on 8.4 and later, but you'll probably want to get the latest version (9.something).
#Postgres osx install#
I want to install a slightly older version, 8.4.7, as I'm using it to develop software that may configureĭownload the Postgresql tarball from here. So, while we don't have to install our own copy of readline,ĭownload the readine tarball as linked from here. The version of readline bundled with OS X has bugs that cause psql to abort during tab completionĪn annoying fraction of the time. We're installing everything in /usr/local/pgsql84.
#Postgres osx code#
To extend it to support PPC code if you need that.

The libpq library is built as a fat binary supporting both i386 and x86_64. We're going to build an installation where the server and client binaries are build for x86_64, but We need to build Postgresql once for each architecture we support, then stitch the different libraries

This doesn't work for Postgresql, for several different reasons. To the compiler and linker commandlines, usually by setting CFLAGS, CXXFLAGS and LDFLAGS before Many applications will build fat binaries on OS X fairly simply, just by adding "-arch i386 -arch x86_64" This is needed not only for building fat binaries, butĪlso for building fat libraries (such as Qt) that depend on libpq. That supports both i386 and x86_64 build. It isn't trivial to build Postgresql from source on OS X in a way that gives "fat" libpq.dylib If, though, you're looking to build Postgresql from source on OS X, read on. Instead, take a look at the one click installer here. If you're just looking to install Postgresql on OS X, this probably isn't what you're lookingįor. Word to the Wise Labs Building Postgresql on OS X
