Я нашел решение своей проблемы
pg_query("BEGIN") or die("Could not start transaction\n");
$dataToUpdate = array('name' => $name);;
$condition = array('id' => $id);
$res1 = pg_update($this->dbConnection, 'table_name1', $dataToUpdate, $condition);
$res2 = pg_update($this->dbConnection, 'table_name2', $dataToUpdate, $condition);
if ($res1 && $res2) {
pg_query("COMMIT") or die("Transaction commit failed\n");
} else {
pg_query("ROLLBACK") or die("Transaction rollback failed\n");;
}