fixed SQL Statements to be postgres compatible
Merge pull request #9 from tbe/master

fixed SQL Statements to be postgres compatible