Diff completed, new postgres function, new handler and test added