Like so many things the answer depends on a lot of factors.
The current chemicals used to pressure treat wood are considered "safe" for a wide variety of uses. Be sure to read the manufacturer's literature to confirm the situations where they recommend using it. That said, there was a time when wood was treated with chemicals that were considered safe at-that-time and are now considered to be poisons. It's hard to predict if the current chemicals will some day be considered to be poisons.
You mention putting in pressure treated posts for a fence at the edge of a garden. If the chemicals are harmful to plants or humans, the risk will be biggest 1) during installation if you breathe in dust 2) after installation as the chemicals get into the ground near the fence line. If you are going to grow ornamental plants near the fence line then that seems like a really low risk situation. The plants might be affected by the chemicals, but it seems unlikely. If you are going to grow food near the fence-line then there's a bigger risk of the chemicals getting into the food and affecting whoever eats the food.
Someone who insists on having a 100% organic garden might choose not to use pressure treated wood for their fence, but then they will likely have to replace the fence a little more often which is damaging to the environment.
You can often get untreated cedar cheaper buying it from a reclaimed materials shop. You might not get all the exact lengths you need, or might have to visit multiple times to get all the wood you need, but it's worth considering. Many wood shops will also sell odd pieces at a discount and if you are creative with how you use them the "odd" elements can become highlights. Another option would be to make friends with a fence builder and ask for them to save their discards or add your order into their next bulk purchase which is likely a cheaper price-point.
Good luck!