아래와 같이 단순화할 수 있을 것 같습니다:
SELECT
t.id AS topic_id,
CURRENT_DATE - t.created_at::date AS days_old
FROM topics t
ORDER BY t.created_at DESC
상대적 시간을 표시하는 데 사용할 수 있는 reltime$time이라는 유용한 함수도 있습니다(다만 30일 미만의 간격에 더 유용하며, 그 이상이면 날짜가 표시됩니다).
SELECT
t.id AS topic_id,
t.created_at AS reltime$time
FROM topics t
ORDER BY t.created_at DESC