Jared Rypka-Hauer, Lead ColdFusion Developer, Minneapolis, MN

Proud Parents of SQLSurveyor and PayPalMX
Viewing By Entry / Main
November 3, 2006 - back to top

Something got me started messing with databases other than MySQL the other day... I tried InterBase/Firebird (from Borlad) and it really was a huge pain in the behind... I removed it. There seem to be some functional oddities in the way it works compared to most DB engines and I just didn't like it. Aside from that, their JDBC driver is screwy, their documention is 2 years old (but the binaries are about 6 months old) and I just really didn't get much out of the experience.

PostgreSQL on the other hand, rulz. I think I'm in love. It's supported by Aqua Data Studio and NaviCat, the install (though not a simple binary install) is still really pretty easy and takes about a half-hour for the basic parts... it's fairly lightweight and seems to be pretty performant.

And as far as the install, it's really not as hard as you might think. In fact, it went flawlessly. Here's a synopsis of the process:

There are a few prerequisites, though:

  • Fink
  • This article from the Apple Developer Connection. This was my guide, so if you run into issues or you just want to read the whole thing, go for it!

I'm going to just give a brief summary of the steps from the Dev Connection article to get you going fast:

  1. Install Fink
  2. Install XCode and tools (which are on your OSX CD/DVD or can be downloaded)
  3. Use Fink to install a package called "readline" (Fink Commander makes this very easy...)
  4. Use the OSX System Prefs Users panel to create a user called "postgres"
  5. Download the PostgreSQL source files from this link
  6. Unzip the above files using BOMArchiveHelper or Stuffit
  7. Put the resulting folder right in your home directory
  8. Start a terminal session (/Applications/Utilities/Terminal)
  9. type (follow each line with the enter key):
    • cd postgresql-8.1.5
    • ./configure --with-includes=/sw/include/ --with-libraries=/sw/lib
    • sudo make
    • sudo make install
    • sudo mkdir /usr/local/pgsql/data
    • chown postgres /usr/local/pgsql/data
    • su -l postgress
    • /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
    • /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
    • createdb test

If the pg_ctl call works, your PostgreSQL install worked and creating of a DB should be fine.

Now download the Postgres JDBC Driver (link here) and drop it into either of the following folders in your ColdFusion application folders:

  • Standalone:
    • runtime/lib
    • lib/
  • Multiserver/J2EE
    • web-inf/lib (where I have mine)
    • web-inf/cfusion/lib

Restart your ColdFusion server.

Now in your ColdFusion Administrator, you can use the following configuration to set up PostgreSQL datasources:

  • URL Format: jdbc:postgresql://localhost/test
  • Driver Class: org.postgresql.Driver
  • Driver Name: optional, I used "postgres jdbc"
  • Username: postgres
  • Password: whatever you used for a password in step 4 above

So there ya have it... fairly quick, a good excercise in using the command line, and a cheap way to get a DB up and running that can, by all accounts, compete with Oracle.

Laterz!

Comments

Hi Jared,

Thanks for the instructions for Mac. I'd like to give this a try soon. For Linux, I recently posted some information to make starting and stopping the PGSQL database a little easier; see: http://tinyurl.com/yl7tvn

-Steve


I wonder how hard it would be to create an installer package and submit it to the PG project?

I've never played around with the installer generator (I think there's one in XCode)... but it could make this process a lot easier, no? Then again, it's not like it's terribly hard anyway.

Laterz,
J


You can see some instructions, which include a link to a package installer, at the following link. Of course, installing from source is best.

http://www.entropy.ch/software/macosx/postgresql/


was this inspired by the cfguru discussion? I wouldn't doubt it as I installed postgres on a w2k3r2 vmware myself. It's a great solution if you're looking to replace Oracle or MsSQL... MySQL can't touch this!


Yeah, it was...

I hadn't really thought much about different options and just went for MySQL right off the bat.

I was totally unimpressed with IB/Firebird, but PGSQL is the bees knees.

Laterz,
J


Nice site.
Look here:
<a href= http://buyasoma.com/internet-casino/map.html >internet casino</a> [url=http://buyasoma.com/internet-casino/map.html]internet casino[/url] <a href= http://xanaxtramadol.com/data-recovery/map.html >data recovery</a> [url=http://xanaxtramadol.com/data-recovery/map.html]data recovery[/url] <a href= http://buyasoma.com/Ibu-200/map.html >Ibu-200</a> [url=http://buyasoma.com/Ibu-200/map.html]Ibu-200[/url] <a href= http://buyasoma.com/order-tramadol/map.html >order tramadol</a> [url=http://buyasoma.com/order-tramadol/map.html]order tramadol[/url] <a href= http://xanaxtramadol.com/investment-advisors/map.html >investment advisors</a> [url=http://xanaxtramadol.com/investment-advisors/map.html]investment advisors[/url] <a href= http://buyasoma.com/california-health-insurance-quote/map.html >california health insurance quote</a> [url=http://buyasoma.com/california-health-insurance-quote/map.html]california health insurance quote[/url] <a href= http://xanaxtramadol.com/zolpidem/map.html >zolpidem</a> [url=http://xanaxtramadol.com/zolpidem/map.html]zolpidem[/url]


Nice site.
Look here:
<a href= http://xanaxtramadol.com/poker-hand-rankings/map.html >poker hand rankings</a> [url=http://xanaxtramadol.com/poker-hand-rankings/map.html]poker hand rankings[/url] <a href= http://xanaxtramadol.com/bad-credit-student-loan/map.html >bad credit student loan</a> [url=http://xanaxtramadol.com/bad-credit-student-loan/map.html]bad credit student loan[/url] <a href= http://buyasoma.com/york/map.html >york</a> [url=http://buyasoma.com/york/map.html]york[/url] <a href= http://buyasoma.com/student-insurance/map.html >student insurance</a> [url=http://buyasoma.com/student-insurance/map.html]student insurance[/url] <a href= http://buyasoma.com/school/map.html >school</a> [url=http://buyasoma.com/school/map.html]school[/url] <a href= http://xanaxtramadol.com/video-poker-games/map.html >video poker games</a> [url=http://xanaxtramadol.com/video-poker-games/map.html]video poker games[/url] <a href= http://buyasoma.com/business-planning/map.html >business planning</a> [url=http://buyasoma.com/business-planning/map.html]business planning[/url]





Aura skin for Raymond Camden's BlogCFC provided by Joe Rinehart.