Applying Grant's IRCdiff.
Use DictCursor to make this a bit easier to read.