Added support for postgres and other sql compliant dbs