Syd borrowed several lines from various poems in this song.
From "Mr Nobody" by Walter de la Mare, there's the lines: "squeaking door will always squeak" and "every plate we break". There is also a line about "scattered pins" which was changed to "scattered needles" in "Octopus".
This section "Madam you see before you stand, Hey ho, never be still, The old original favorite grand. / Grasshoppers green Herbarian band And the tune they play is." is from "Rilloby-Rill" by Henry Newbolt.
"Man on the border" comes from Edward Lear.