Changed sqlite3 to pg