Changed db to pg from sqlite