fixed postgresql dialect bugs