Made changes to work with multiple databases in feature
Added pgsql support