replaced sqlite3 with pg