wrap postgres driver into transaction