25 Holy David lost two sons; the one incestuous, the other a parricide. To have had them was a disgrace, to have lost them a grief. And he lost a third, the infant whom he loved. Him he wept for while still alive, but did not long for when dead. For so we read, that, while the child was sick, David entreated the Lord for him, and fasted and lay in sackcloth, and when the elders came near to raise him from the earth, he would neither rise nor eat. But when he heard that the child was dead, he changed his clothes, worshipped God, and took food. When this seemed strange to his servants, he answered that he had rightly fasted and wept while the child was alive, because he justly thought that God might have mercy, and it could not be doubted that He could preserve the life of one alive Who could give life to the departed, but now, when death had taken place, why should he fast, for he could not now bring back him that was dead, and recall him who was lifeless. “I,” said he, “shall go to him, but he shall not return to me.”
Source: On the Death of Satyrus (New Advent)