I need to update some rows of the tables and then display these rows. Is there a way to do this with one single query and avoid this 2 query ? :
UPDATE table
In PostgreSQL v8.2 and newer you can do this using RETURNING:
UPDATE table SET foo=1 WHERE boo=2 RETURNING *