Query result with X rows discarded
In a transaction (or in an SQL function) only the results from the last command are returned to the user. You could write the results to a (temporary) table to inspect them later.

Or you run through your transaction interactively, executing one command after the other.