How should I paint cedar and pressure-treated pine?
I don't know about the cedar, but I built a screened porch a few years ago using standard PT lumber for posts and railings and painted it with a coat of primer and a coat of exterior latex pretty much as soon as it no longer appeared damp.  Of course the 6X6 posts had been up and drying for a while at that point, probably 6 months or so.  The railings were installed last and were probably only up for 2 or 3 weeks when they were painted.  When we moved from that house earlier this year there were no problems with the paint, and that was after about 2 years.

Interestingly, the only paint-related issue we had was some peeling on the existing deck railings, about 4 years old and never painted at that point, that I painted at the same time to match the new railings around the porch.  I have no idea what caused it, but I can say that I didn't prepare this older wood at all and it probably could have used at least a good pressure washing prior to painting.