My piano teacher never said this, but my band director insisted we sit straight, march straight, and hold our horns out straight (trumpets & trombones particularly). Heads straight up. This was reinforced by marching in the US Army where that is the proper posture. I'm 63 years old and have no back pain, so I would say it is good advice.
A general exercise program of the back neck and abdomen muscles is required to build these to the needed strength. Carrying a pair of cymbals while marching (and spinning them over my head), and carrying my books and instrument home from band practice (1.5 miles) was enough for me in my teens, but now I go the the gym and cycle around the arm upper body machines. If you have floor space you can do Pilates exercises like Margeret Richards demonstrates on PBS every morning. Piano is semi-atheletic exercise, and being in shape helps. Being in shape also helps with the aches and pains of daily life, and keeps one from being a couch potato.
Notice there is a difference between muscle pain, which is normal when you are building up strength, and numbness in limbs or sharp spinal pain. If you have the latter see a physician. Muscle pain is more a problem for personal exercise trainers or an exercise program from a book or video.
I've noticed the gym with the machines doesn't teach stretching to new people, so look up the US Army Daily Dozen or some similar program, as tight muscles need to be stretched every day before exercise. These exercises came from a program of exercise records and book sold in the 1920's I found out by watching PBS history detectives.
Use it or lose it. A neighbor bought one of those electric wheel chairs to get around in, and after 3 years of retirement died. I'm going into my fifth year after stopping working and am in better shape than in years, my heart and metabolic numbers are lower, and I'm playing harder piano pieces than I ever played before.