Saute the grated pumpkin in a little butter, after salting it lightly, until the liquids evaporate. In a pot, boil the milk with the rice until the mixture thickens. When it is ready, add the pumpkin and stir well. Add sugar, eggs, vanilas and cinnamon and stir again.
Butter a baking dish, line it with 4 buttered crust sheets and pour over them half of the mixture. Continue with another 4 sheets, pour the remaining mixture and, finally, place on top the remaining 4 sheets, always buttered.
Carve the sheets, sprinkle them with water and bake in a preheated oven at 200° C (392° F) until the pie turns golden brown (for about 50 minutes). 5 minutes before the baking is over, remove the baking dish from the oven and brush the pie with the remaining butter. Sprinkle it with caster sugar and put it back in the oven for 5 minutes.