Technically goldfish dont get pregnant. but if they are in season (summer months normally) the can get 'Spawnbound' full up with eggs and nowhere for them to go. this can be fatal for fish in tanks.
In a pond male goldfish will chase females around the pond and as she swims through pond-weed and plants she will deposit her eggs, the male follows and fertilises them. if you have a spawnbound female you can stimulate her into releasing the eggs by gently tickling the sides with fish with pond weed.
Aside from this there could be other reasons for the swelling. infections, abcess's, tumers are quite common.
How is it swimming?
How big is it?
Is it alone?
How old is it?
What is its environment like?