Fixed postgresql integration

Now this works!