postgres gem added and query fixed.
postgres gem added and query fixed.