Adding postgres gem for dev; fixing issue with postgres grouping and ordering