As with disk iotop, use pg_top for postgresql
Debian install package pgtop
Redraw the screen.
Display the actual query plan (EXPLAIN ANALYZE) of the currently running SQL statement by re-running the SQL statement (prompt for process id.)
Toggle the use of color in the display.
Toggle the display of the full command line.
Change the number of displays to show (prompt for new number). Remember that the next display counts as one, so typing d1 will make pg_top show one final display and then immediately exit.
h or ?
Display a summary of the commands (help screen). Version information is included in this display.
Display re-determined execution plan (EXPLAIN) of the SQL statement by a backend process (prompt for process id.)
Display a list of system errors (if any) generated by the last kill or renice command.
(or I) Toggle the display of idle processes.
Send a signal ("kill" by default) to a list of processes. This acts similarly to the command kill(1)).
Display the currently held locks by a backend process (prompt for process id.)
Order by memory utilization.
Sort by process id.
n or #
Change the number of processes to display (prompt for new number).
Change the order in which the display is sorted. This command is not available on all systems. The sort key names when viewing processes vary fron system to system but usually include: "cpu", "res", "size", "time". The default is cpu. When viewing user table statistics: "seq_scan", "seq_tup_read", "idx_scan", "idx_tup_fetch", "n_tup_ins", "n_tup_upd", "n_tup_del". The default is seq_scan. When viewing user index statistics: "idx_scan", "idx_tup_fetch", "idx_tup_read". The default is idx_scan.
Sort by processor utilization.
Display the currently running query of a backend process (prompt for process id.)
Display user table statistics.
Change the priority (the "nice") of a list of processes. This acts similarly to the command renice(8)).
Change the number of seconds to delay between displays (prompt for new number).
Order by time.
Toggle between cumulative or differential statistics when viewing user table or user index statistics.
Display only processes owned by a specific username (prompt for username). If the username specified is simply "+", then processes belonging to all users will be displayed.
Display user index statistics.