Replaced sqlite3 with pg