In women's sizes, US size 9 = UK 7 =Europe 27 = Mexico 6.5 =Spain-Italy 39.
As noted above size 9 would have been large for a 19th century woman.
The real reason for that size in the song, as pointed out by Masato, is that few would know what Digby pine is, and nine is a good substitute because the rhyme remains.