Sounds like there's a loose connection somewhere on the hot (black) wire.
With the breaker off, open up the switch and look for the use of "back stab" connections. This is where the wires are pushed into a hole in the back of the switch and held in place by a little brass spring. They're very quick and easy connections to make so lazy electricians and DIYers love them, but they're prone to failure over time. Note that a back-stab is different from a side-wire. With a side-wire, the wire is stuck straight in, then held down by a screw clamp on the side of the switch. These are the premium connections because they're much easier to make, but they have the advantage of the properly torqued screw holding the wire in place. If you find these you're in good shape! But, you'll still need to check for proper torque (if not listed on the device, search the internet for
<brand> <model> torque setting).
If you find a back stab, pull the wire out (there should be a slot where you can stick a tiny screwdriver to release the spring), wrap a proper shepherd's hook in the bare wire (you may need to strip back a little more insulation), pull the hook around the screw (wrap the wire clockwise, the way you'll turn the screw as you tighten), and tighten the screw down to the proper torque setting.
NOTE: If there are more wires in the box than you can be 100% sure of keeping straight from memory, take a picture of all the wiring and/or put tape flags on things so you can be sure that you can reassemble exactly the same way you disassembled. When replacing a switch (which is sort-of what you're doing), I usually disconnect/reconnect one wire at a time, but it's not always possible to do this. We've had dozens, if not hundreds, of "HELP! I took the wiring apart and now I can't get it to go back together so it works" questions here. Don't write the next one...
Even if the wires are wrapped around the screws, they may not be torqued down tight enough, so it's worth checking that.
This will confirm your hot wire connections. The white (neutral) should be connected at the back of the box under a wire nut. Hold each wire nut, and give each of the individual wires in it a good tug. If any of them have any movement, you'll need to disassemble the wire nut, make sure all the wires are properly inserted (all the solid wires are the same length, the stranded ones should be a bit longer), then tighten the nut. You'll have to crank down on that wire nut a lot harder than you think to ensure it's properly tight. Once you've tightened it, do the tug-test again to make sure the connections are really solid.
You can wrap the nut in electrical tape if you want, but it really won't do anything to improve the connection. If you think you need to wrap it to protect the bare wire sticking out from under the nut, then pull the nut off, trim the bare wire down a bit and put the nut back on. There should never be bare wire sticking out from under a wire nut.
Once you've checked at the switch, put it all back together in the wall, turn the breaker on & check the functionality.
If it's still misbehaving, turn the breaker off, go to the porch light, disassemble it, and double check all the wires behind that.
Reassemble the porch light & test again.
If the post lamp is still not working, lather, rinse, repeat for all the wiring at the post lamp.
Odds are good that one of these exercises will have it fixed. If not, there may be another junction box somewhere between the porch light and the post light an the loose connection may be there. That will require research and wire tracing on your end - nothing we can do to help you find it from this side of the internet.
Note: You could start at the post light and work backwards, but you'll probably stop checking things when the post light works, and it's always worth eliminating back-stab connections at switches and outlets, hence my recommendation to start there.