Fixed most of the postgres compatibility issues fixes #8 however issue
#9 is still a problem as well as #11