In the ideal case, you should sit comfortably on a chair with a straight spine. Your back should not be curved while you sit on a chair. Look straight ahead, and never lower your head to see the computer. Make sure your feet rest on the floor, while the knees are bent at a 90-degree angle with the ground.
Ladies will have to make it a habit to sit on their office-chair without their heels. They make it almost impossible to get the 90-degree angle with the floor. Using heels in general is also not recommended as it results in pain in the lower back area. For the men, it is highly recommended to empty out their hip pockets before sitting on the chair. The heavy wallet does make a difference to the comfort of the pelvis.
The computer's height should be aligned such that it makes a perfect alignment with the eyes. The most important point is to take a short walk along the aisle every 20-30 minutes to make sure blood is flowing well between the veins and arteries. You may even consider opting for some yoga to counter the pain.
If you still feel your posture in your office is the cause behind the excruciating pain you feel, don't hesitate to take an appointment with a physician. He is the only one who can guide you on maintaining the ideal posture such that it doesn't lead to a pain. He may also prescribe some exercises and he may even point out some exercises you are to avoid.