The psychological meaning of anal-retentive means that the child was traumatised somehow during toilet training. Perhaps their parents scolded and punished them instead of encouraging and rewarding them. They became fearful of using the toilet. In adulthood, after toilet training, this person might still have problems around using toilets leading to constipation, etc. Or they might develop other anxieties in other areas of life.
In everyday language, we use 'anally retentive' to describe somebody who is annoying because they are obsessed by small, trivial details.