Posted by tobi — 09:47 AM Dec 14
This is a quick guide on how to setup postgres 8.1 under osx using DarwinPorts:
% sudo port install postgresql8
% mkdir -p ~/Databases/Postgres
% mate /etc/profile
# Append following lines to the file:
export PATH=/opt/local/lib/pgsql8/bin:$PATH
export PGDATA=$HOME/Databases/Postgres
% source /etc/profile
# compile postgres ruby drivers
% sudo gem install postgres --
--with-pgsql-include-dir=/opt/local/include/pgsql8/
--with-pgsql-lib-dir=/opt/local/lib/pgsql8/
# create the postgres DB
% initdb
# start your database server. pg_ctl supports start / stop / reload
% pg_ctl start
# create the root superuser
% createuser root
# create your db
% createdb blog_dev
If you want to get rid of the NOTICE spam which appears when running rake open $PGDATA/postgresql.conf change client_min_messages from notice to warning and run “pg_ctl restart”.
Update: Dave let me know that instead of using the postgres gem you should be using
sudo gem install ruby-postgres

Robby Russell 14 Dec 10:32
Don’t forget to do a few more things… like:
Inside the directory generated with initdb you will find pg_hba.conf. At the bottom of that fileyou will want to replace the word ‘trust’ with ‘md5’
This will force a password to be used when connecting to PostgreSQL on the local machine. :-)
I look forward to hearing more about your cough migration. ;-)
tobi 14 Dec 11:07
trust should be a reasonable setting for a local dev machine though?
Amr Malik 14 Dec 18:18
Awsome-o!
dave 15 Dec 11:52
New releases of the ruby-postgres extension are available with the gem name ‘ruby-postgres’ (as opposed to ‘postgres’ used in the example. The current snapshot (0.7.1.2005.11.27) has a bug with array quoting, but I’ll be releasing a 0.8.0 release in the coming days that fixes this bug. If you’re not using array quoting, then this release should be safe. I’d love to see some additional testers, especially of the osx variety.
The new releases have a better build script, relieving the need to specify
--with-pgsql-*when you have the postgresql /bin in your path.so instead of:
run:
tobi 15 Dec 14:11
ruby-postgres behaves odd here. For example it complains about unmatched null constrains for all fixtures which don’t list each and every attribute of a table.
This seems to be correct behavior in postgres but the old adapter didn’t require this…
Rob 19 Dec 19:18
cool!
test 22 Dec 02:24
test
test 22 Dec 02:24
test
null 23 Dec 19:17
yep
test 23 Dec 19:18
test
null 24 Dec 18:39
meh rofl
ers 26 Dec 03:32
rers
me 27 Dec 23:04
test
hangon 28 Dec 12:57
test
test 29 Dec 12:00
test
asdfasdf 01 Jan 20:31
asdfasdfasdfasdfsdafasdf
matt 06 Jan 15:48
cool, thank you