sqlalchemy postgresql pg8000 return affected rows

194 Views Asked by At

How can I return affected rows when using SQLAlchemy + PG8000 for PostgreSQL.

Before you respond with, use rowcount, SQLAlchemy mentions that:

This attribute returns the number of rows matched, which is not necessarily the same as the number of rows that were actually modified.

It's possible that an update statement on my system could run twice, where the second time it runs the data is not actually being updated because nothing needs to change.

Is there a way to see what records change when performing an update? Something like rowcount would be nice.

0

There are 0 best solutions below