Changed db to PGSQL from sqlite3