changed sqlite3 with pg