An exterior-grade yellow woodworking glue may work fine for outdoor projects, such as repairing a deck railing post that has a piece broken off, especially if it’s protected by a coat of paint. But it’s not my first choice. I would use a polyurethane-based glue. It’s fully waterproof and bonds wood and other materials well. It’s not gap-filling, so be sure to get a good fit and clamp it.
Have the necessary tools for this DIY project lined up before you start—you’ll save time and frustration.