This phrase has absolutely nothing to do with getting drunk.
More accurately, 'pissing down the barrel', a phrase used by the British Army of the Napoleonic Era. Referring to the battlefield expedient of urinating down the barrel of a musket to clear black powder residue, when you didn't have the time or opportunity to clean it properly with clean water. The phrase became a way of referring to any action taken as an improvised expedient; then becoming a synonym for emergency or last-chance measures; and finally used to refer to any action that seems hopeless or with little chance of success.
"Dig in and hold them as long as you can."
"We may as well be pissing down a barrel."
"The approach will not be easy. You are required to manoeuvre straight down this trench and skim the surface to this point. The target area is only two meters wide. It's a small thermal exhaust port, right below the main port. The shaft leads directly to the reactor system. A precise hit will start a chain reaction which should destroy the station. Only a precise hit will set up a chain reaction. The shaft is ray-shielded, so you'll have to use proton torpedoes."
"That's impossible, even for a computer. It's like trying to piss down a barrel!"