There are certain veggies which are very well adapted to seed saving. Beans, peas, lettuce, are the easiest because they do not out-cross so the seeds you get generally will breed true.
There are others that work well such as most of the crucifers (broccoli, kale, bok choi, etc) as long as you don't have other crucifers growing near by. These are insect pollinated and form hybrids very easily. But if you are just growing them for the leaves, you'll still get something good to eat even if they are hybrids.
Peppers also breed true if you are only growing one variety.
The group that is the most difficult to save good seed from are the cucurbits - the viners such as melons, cukes, squash, pumpkins. These hybridize like crazy, and since many of them are grown from hybrid seed, you are likely to get all sorts of off-spring. A real science experiment.
Back to the pumpkin. Your seed likely will grow something, but who knows what the off-spring will be. It depends what else in that family that the farmer was growing near-by. But if his pumpkin field was large, the odds are in your favor that your seed was the result of 'pumpkin to pumpkin' pollination. I've saved seed from grocery store squash that turned out just fine.
Good luck and tell us what happens.