Around my neighbourhood there are guys who seem to like using dogs and a knife for hog hunting. I prefer to have a rifle, but sometimes I don't carry one. I have occasionally attached a Cold Steel Bushman knife to a stick to dispatch hogs, and this is safer and more convenient than getting up close enough to use a hand-held knife. (In some places it is unwise, unsafe or illegal to carry or use a firearm).
When hunting hogs with dogs, you have to be very careful using a gun. You don't want to shoot a dog with a bullet that glances off a bone or a nearby rock, and you don't want to subject the sensitive hearing of a dog to a big bang.
When you have good dogs and know them well, it can be comparatively safe and simple to grab the pig by a back leg and tip it over so you can finish it with a knife. When I was taught to stick pigs, the preferred place to thrust in the knife was into the artery in the 'soft spot' alongside the brisket. However this means that your arm gets fairly close to the pig's mouth and tusks so you have to be careful.
Nowadays I kill a few pigs with a blade when I've caught them in a snare. I will generally only tip the smaller pigs over on to their backs before I stick them. With bigger pigs I insert the knife behind the shoulder, driving it forward into the vitals. Sometimes, when I've had a short knife, I've even pushed the handle into the pig as well... just to make sure.
I've hunted for years, but I've only been charged by pigs twice. Both times it was when they were caught by a foot in a snare. You have to be really careful when getting close to a pig. They seem to go from stationary to 100 mph before you can blink. And they can jump higher than I would have thought. There are a few videos on YouTube showing pigs caught in a JaegerPro trap where the hogs jump high and ram the walls of the trap. These videos would probably be quite sobering for a number of our hog hunters who go out armed with just a knife.
I think that generally pigs will only charge when really angry or when you are standing on the best escape route. In my experience, they mostly run off when they see me. It pays to be careful though.
My dad told me a story about one of his older friends that was out on the hills of his farm when his beloved dog bailed a pig. Evidently the pig was giving the dog a hard time. The guy dived on the pig and grabbed it with a 'bear hug'. He reached for his sheath knife but found that it wasn't in the sheath. This had now become a difficult situation. He rolled down the hill with the pig till he reached a small creek. He held the pig's snout under the water until it drowned.
So... if there is a creek or a lake within a few hundred yards, you don't even need a knife to hunt pigs.