Revise all places where jobs need to be returned (releaseJob()) to the JobPool, especially for requeueing and failures
Currently we are using releaseToPool() method to release job objects back to a job pool. Using a unique pointer should remove this responsibility from the caller, in principle. In the current implementation this is a middle-ground which shall be improved by using a custom deleter for the unique pointer. This will require changes at many places of the code which are not necessarily related to only Postgres Scheduler DB.
Edited by Jaroslav Guenther