Iterate psql commands.