Nice post vadracas. I am conflicted now.
See the wikipedia article concerning the
Tueller Drill for example. Not sure what your definition of close quarters is, but apparently anything closer than 6 m / 20 ft will likely end up with you getting stabbed if you start holstered. At greater distances you're almost certain to get stabbed and incapacitated if you miss your first shot and your attacker doesn't stop/let up since you have to realign your gun with the target. Guns have an inherent disadvantage in close quarters, especially if the shooter isn't alerted to the threat.
Melee weapons don't have to be unholstered and aimed, for one thing, nor do they have to be cocked/charged. They also can't misfire if they are improperly maintained, and even an edged weapon that isn't overly sharp can kill or incapacitate an opponent if you apply enough force. Blunt weapons can break bones and cause internal bleeding even through body armor and there's a difference between stab and spike attacks. Stab-type attacks cut (think knives/bladed weapons), while spike-type attacks (think needles/pointed objects) work by slipping through fibers that make up clothing/protection. Stab-proof vests might not protect against spike attacks and vice-versa, though there are vests that protect against both types of attacks.
The best (and historically proven) protection against melee attacks is a shield and helmet - which also protect the wearer from missile-type attacks (sling, brick, other low velocity objects). As far as I can tell guns are pretty shitty at parrying or deflecting knives, let alone anything bigger/heavier (and even if you're successful they are likely to break/misfire and you're still at a disadvantage).