Shiva and Gajasura
Once, while Goddess Parvati wanted to take a bath, there were no attendants around to guard her and stop anyone from accidentally entering the house. Hence she created an image of a boy out of paste which she prepared to cleanse her body, and infused life into it, and thus Ganesha was born. Parvati ordered Ganesha not to allow anyone to enter the house, and Ganesha obediently followed his mother's orders. After a while Shiva returned from outside, and as he tried to enter the house, Ganesha stopped him. Shiva was furious at this strange little boy who dared to challenge him. He told Ganesha that he was Parvati's husband, and demanded that Ganesha let him go in. But Ganesha refused to hear him. Shiva lost his patience and had a fierce battle with Ganesha. At last he severed Ganesha's head with his Trishula. When Parvati came out and saw her son's lifeless body, she was very angry and sad. She demanded that Shiva restore Ganesha's life at once.
Unfortunately, Shiva's Trishula was so powerful that it had hurled Ganesha's head very far off. All attempts to find the head were in vain. As a last resort, Shiva approached Brahma who suggested that he replace Ganesha's head with the first living being that came his way which lay with its head facing north. Shiva then sent his disciples to find and take the head of whatever creature they happened to find asleep with its head facing north. They found a dying elephant which slept in this manner, and after its death took its head, attaching the elephant's head to Ganesha's body and bringing him back to life. From then on, he was called Ganapati, or head of the celestial armies, and was to be worshipped by everyone before beginning any activity.
The gaze of Shani
Once there existed an demon (Asura) with all the characteristics of an elephant, called Gajasura, who was undergoing a penitence (or tapas). Shiva, pleased by him, decided to grant him, as a reward, whatever gift he desired. The demon wished that he could emanate fire continually from his own body so that no one could ever dare to approach him. The Lord granted him his request. Gajasura continued his penitence and Shiva, who appeared in front of him from time to time, asked him once again what he desired. The demon responded: "I desire that You inhabit my stomach."
Shiva granted even this request and he took up residence in the demon's stomach. In fact, Shiva is also known as Bhola Shankara because he is a deity easily propitiated; when he is satisfied with a devotee he grants him whatever he desires, and this, from time to time, generates particularly intricate situations. It was for this reason that Parvati, his wife, sought him everywhere without results. As a last recourse, she went to her brother Vishnu, asking him to find her husband. He, who knows everything, reassured her: "Don't worry, dyour husband is Bhola Shankara and promptly grants to his devotees whatever they ask of him, without regard for the consequences; for this reason, I think he has gotten himself into some trouble. I will find out what has happened."
Then Vishnu, the omniscient director of the cosmic game, staged a small play. He transformed Nandi (the bull of Shiva) into a dancing bull and conducted him in front of Gajasura, assuming, at the same time, the appearance of a flutist. The enchanting performance of the bull sent the demon into ecstasies, and he asked the flutist to tell him what he desired. The musical Vishnua responded: "Can you give me that which I ask?" Gajasura replied: "Who do you take me for? I can immediately give you whatever you ask." The flutist then said: "If that's so, liberate Shiva from your stomach." Gajasura understood then that this must have been no other than Vishnu himself, the only one who could have known that secret and he threw himself at his feet. Having liberated Shiva, he asked him for one last gift: "I have been blessed by you with many gifts; my last request is that everyone remember me adoring my head when I am dead." Shiva then brought his own son there and substitued his head with that of Gajasura. From then on, in India, the tradition is that any action, in order to prosper, must begin with the adoration of Ganesha. This is the result of the gift of Shiva to Gajasura.
On the insistence of Shiva, Parvati fasted for a year to propitiate Vishnu so that he would grant her a son. Lord Vishnu, after the completion of the sacrifice, announced that he would incarnate himself as her son in every kalpa (eon). Accordingly, Krishna was born to Parvati as a charming infant. This event was celebrated with great enthusiasm and all the gods were invited to take a look at the baby. However Shani (Saturn), the son of Surya, hesitated to look at the baby since Shani was cursed with the gaze of destruction. However Parvati insisted that he look at the baby, which Shani did, and immediately the infant's head fell off and flew to Goloka. Seeing Shiva and Parvati grief stricken, Vishnu mounted on Garuda, his divine eagle, and rushed to the banks of the Pushpa-Bhadra river, from where he brought back the head of a young elephant. The head of the elephant was joined with the headless body of Parvati's son, thus reviving him. The infant was named Ganesha and all the Gods blessed Ganesha and wished Him power and prosperity.
Another tale of Ganesha's birth relates to an incident in which Shiva slew Aditya, the son of a sage. Shiva restored life to the dead boy, but this could not pacify the outraged sage Kashyapa, who was one of the seven great Rishis. Kashyap cursed Shiva and declared that Shiva's son would lose his head. When this happened, the head of Indra's elephant was used to replace it.
Still another tale states that on one occasion, Parvati's used bath-water was thrown into the Ganges, and this water was drunk by the elephant-headed Goddess Malini, who gave birth to a baby with four arms and five elephant heads. The river goddess Ganga claimed him as her son, but Shiva declared him to be Parvati's son, reduced his five heads to one and enthroned him as the Controller of obstacles (Vigneshwara).