The Goldfish Sanctuary
If your fish is having trouble passing feces, or if they are constantly trailing behind a fish, your fish has constipation. This is often caused by a diet without enough variety, or by feeding too many starchy foods.
This problem is easily solved by feeding your fish a diet with more variety and roughage. Some suggestions are live foods, peas, spinach, and tubifex worms. Enticing your fish to swallow one grain of Epsom salt is also said to be beneficial.
It is also advised that dry fishfood be soaked in water until it is soft before feeding it to your goldfish. This helps in digestion, and also reduces the likelihood of constipation.
The problem should clear up in a day or two. If it does not, you are advised to contact a vet or pet expert for further instruction.