Link to home
Start Free TrialLog in
Avatar of mock5c
mock5c

asked on

Simulate an update query in Postgres

Is there a way I can simulate an update query so it will tell me a certain of number of rows would be updated but doesn't actually update them?
ASKER CERTIFIED SOLUTION
Avatar of pmctrek
pmctrek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
rewrite your update into SELECT:
select count(*) from ... where ...
use transaction control and rollback your changes.
begin work;
update xxx...
rollback work;