Pensions are fine if employers accurately discount present wages for the expected payment of future wages, and accurately forecast future population growth to maintain a good ratio of workers to retirees.
Some governments seem to be quite bad at this though. States differ in pension liabilities and I haven't looked at the federal level.