There are a number of legends of Lord Ganesha and Lord Shiva mentioned in the Mahapuranas and Upapuranas, namely Shiva Purana, Padma Purana, Ganesha Purana, Brahmavaivarta Purana, Linga Purana, Mudgala Purana and Varaha Purana. Lord Ganesha is the God of wisdom and intellect and the patron of sciences and arts. He is widely worshipped by Hindus, Buddhists and Jains as well. The God with the head of an elephant also is considered as the deity of good fortune, new ventures and wisdom. Ganesha is worshipped before the commencement of any new venture or rituals and is regarded as the destroyer of selfishness, pride and vanity. He is the son of Lord Shiva and Goddess Parvati and the brother of Lord Kartikeya (Skanda). Lord Ganesha is also known as Vinayaka, Surpakarna, Ekadanta, Lambodara, Gajanana and Vighnesa.
The Linga Purana describes an interesting tale about the childhood of Ganesha and his relationship with his father. Lord Shiva usually adored Ganesha and kissed him on the cheeks before his son allowed him to depart. But once Shiva somehow ignored the child during the time of departure and mounted on his divine chariot, which was created by Lord Brahma. This made Ganesha upset and angry and thus he prohibited all the deities and gods from following Lord Shiva. Subsequently, he threatened to raise hindrances, as he was created for this purpose by his father.
This incident terrified all the deities and gods, including Lord Indra. The gods then tried to appease Lord Ganesha by presenting with his favorite foods and other gifts. But he still remained upset. Later Lord Shiva realized his negligence and returned to his abode to embrace his son. Ganesha was then kissed on the forehead by his father, after which Shiva departed on his assignment. Finally Ganesha became pleased after being loved by his father. Then he permitted the other gods and deities to proceed and follow Lord Shiva without any hindrance.
The Linga Purana, one of the 18 Mahapuranas, also states that Shiva himself performed all the ceremonies of Ganesha after his birth. Whenever Shiva held Ganesha in his arms, the noble child became immensely pleased. His father kissed and embraced the child and declared that he was created to annihilate the demons and to help the other gods and deities. Shiva stationed his son in the heavenly path to created obstacles for the asuras and the other demons.