Merge pull request #6 from mcs07/master

Tidy up formula and add postgresql option