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?
mock5cAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
pmctrekConnect With a Mentor Commented:
Not sure if this will work raw or you may need pl\PgSQL installed on the database.

BEGIN
  UPDATE .....
ROLLBACK
0
 
sdstuberConnect With a Mentor Commented:
select count(*) from your_table
where (your-update-where-clause-here)
0
 
gheistCommented:
rewrite your update into SELECT:
select count(*) from ... where ...
0
 
earth man2Commented:
use transaction control and rollback your changes.
begin work;
update xxx...
rollback work;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.