Generalize withPG, fix withTransactionMode