Th phrase “when pigs fly’ is an adynaton- a figure of speech so hyperbolic that it describes an impossibility. The implication of such a phrase is that the circumstances in question will never occur. The phrase has been used in various humorous forms since the 1600s as a sarcastic remark. The phrase is often used for a humorous effect.

An example occurs in the film “The Eagle Has Landed”. In one scene, an Irish secret agent working for the Nazis replies to a German general speaking of Germany’s shortly winning WWII, “Pigs may fly, General, but I doubt it!” Later, when the Irishman sees German soldiers parachuting before an attack, he says to himself, “Mother of God! Flying pigs!’.

Other examples where this phrase has been or is used include in Grand Prairie, Texas, the semi-pro baseball team is called the Grand Prairie AirHogs. In advertising, they have used the slogan “Where Hogs fly”. In Lewis Carroll’s “Through the Looking- Glass” (1872), the poem “The Walrus and the Carpenter” poses the question of “whether pigs have wings.” Pigasus was a flying pig character in the “Oz” books written by Ruth Thompson in the 1930s.

Pink Floyd had a flying pig on the cover of their 1977 album “Animals”. Also, “When Pigs Fly” is the second track on the 1997 album “Till the Cows Come Home” of German metal band Farmer Boys.

More Info: en.wikipedia.org