If you're in a state job, yes. Truth is, many pensions are underfunded and many pension fund managers take dangerous investment risks to try to make up for those underfundings. Yes, pensions bet on markets the same way you would in your 401k to produce gains, its not just a cash slush savings where a set amount is paid in and out per employee.
Now, for the scary part: underfunded pensions go into emergency mode and seek additional contributions from the companies involved. Problem is, retirement and pension funds are a 50-80 year endeavor for most employees and industries do not last as long as they used to. Industries can dry up in a decade and all their companies vanish. You're left with an underfunded pensions and no one to foot the bill, and get screwed when pension benefits get reduced to prevent fund insolvency.
Pensions work well for the govt, at least until you pull a Greece. Pensions for the private sector can be more dangerous than 401k options because of the speed of our technological advances and economy.