What is the origin of the idiom 'If pigs could fly'?

in Ireland that term was given to show the impossible.