fixing pg error, using sqlite3