patch to add affected_rows to Postgres