Bicycle seatposts come in various diameters such as 27.2, 30.0, 31.6 to name a few common ones, as well as various lengths. Smaller bikes will generally need a shorter seatpost and may use a smaller diameter, but not always. Seatposts also have a setback. A zero setback will locate the seat directly over the top of the seatpost and is more conducive to a forward position, whereas a 25mm setback will be located 25mm rearward. If your seatpost is dropping you may need to replace your seatpost clamp, especially if the clamp opening is almost closed. Mountain bikes may use a "dropper" seatpost which allows the seat to remotely drop out of the way for easy maneuvering.