Use postgres deb version compare function
Ticket moved to GitHub: "pulp/pulp_deb/386":https://github.com/pulp/pulp_deb/issues/386
There is a DebVersion extension that allows for comparison operations between Debian package versions directly in postgres.
This has been successfully packaged for Katello.
pulp_deb could also benefit from this existing work.