Let me take a moment to search and see what I can find.
The idiom is apparently derived from a centuries-old Scottish proverb, though some other references to pigs flying or pigs with wings are more famous. At least one appears in the works of Lewis Carroll:
"Thinking again?" the Duchess asked, with another dig of her sharp little chin. "I've a right to think," said Alice sharply, for she was beginning to feel a little worried. "Just about as much right," said the Duchess, "as pigs have to fly...." — Alice's Adventures in Wonderland, Chapter 9.
American literature author John Steinbeck was told by his professor that he would be an author when pigs flew. When he eventually became a novelist, he started to print every book he wrote with the insignia "Ad astra per alia porci" (to the stars on the wings of a pig).[3]