changing db to postgresql and updating great minds queries