Some years ago, I remember reading that during the scripting of The Goons Spike Milligan wanted the sound effect of someone being hit over the head by a sock full of custard. He asked the BBC canteen ladies if they could make him some custard. This they did - only to be somewhat dismayed when he didn't eat it but poured it into a sock. I don't know whether it achieved the desired sound effect.
My daughter is a big fan of The Chuckle Brothers and I recently took her to see them live. They had loads of 'custard pies' and eventually decided to attack a member of the audience with the lot. As that member of the audience, I can confirm that it is shaving foam and it tastes bloody disgusting!