Changed to pg instead of sqlite3