Let's set a little context first; it will matter. This passage appears in Chapter XCI, "Smoking-Club in a Man-of-War", which discusses the universal human routine of gathering together somewhere and chit-chatting, gossiping.
Metropolitan gentlemen have their club; provincial gossipers their news-room; village quidnuncs their barber's shop; the Chinese their opium-houses; ...
As the title suggests, aboard ship, this happens in the galley (dining area), which is the only place the sailors are allowed to smoke their pipes. So the scene Melville is setting here is a bunch of working-class sailors sitting around in the kitchen post-meal, smoking, and gossiping.
He starts the description of their interaction with
Not a few were politicians
Here, "not a few were politicians" is litotes for "many of the sailors thought themselves politicians" i.e., held out on political topics during these nightly social gatherings.
and, as there were some thoughts of a war with England at the time, their discussions waxed warm.
The political topic du jure in this scene is a potential war with England (the sailors were American, or "Yankee", and less than a century prior that nation had fought and won a war of independence from England, so there was some lingering friction, social and political). The conversation got somewhat heated.
what the heck are they saying?
"I tell you what it is, shippies!" cried the old captain of gun No. 1 on the forecastle, "if that 'ere President of ourn don't luff up into the wind, by the Battle of the Nile! he'll be getting us into a grand fleet engagement afore the Yankee nation has rammed home her cartridges--let alone blowing the match!"
Here, the old captain of gun No. 1 says "if the President doesn't slow down / put on the brakes, he'll get us into a naval war with England before we (the Americans, the Yankees) have even gotten to load our guns".
"Who talks of luffing?" roared a roystering fore-top-man. "Keep our Yankee nation large before the wind, say I, till you come plump on the enemy's bows, and then board him in the smoke," and with that, there came forth a mighty blast from his pipe.
Another sailor ripostes "What's this talk of slowing down? We should sail full speed until we can see the enemy's ships and board them" (he's speaking metaphorically, but basically he's a proponent of going to war).
"Who says the old man at the helm of the Yankee nation can't steer his trick as well as George Washington himself?" cried a sheet-anchor-man.
This guy supports the foretopman by saying "Yes, who says the President can't steer this ship during his term as well as George Washington did during his?" (Washington being a hero of the Revolutionary War, its top general, the first president of the fledgling nation, and a venerated founding father).
"But they say he's a cold-water customer, Bill," cried another; "and sometimes o' nights I somehow has a presentation that he's goin' to stop our grog."
Now this sailor is responding to the sheet-anchor-man who was comparing the current President to George Washington. The ball has bounced from peace dove to war hawk, from pro-President, now, to anti-President. He's not praising the President as the prior sailor has.
a bucket of cold water
He's worried this president will "stop our grog". In a naval context, this usually means "end our rations of booze", usually as a punishment aboard ship for some infraction. But this sailor is using it more broadly: stop all booze.
What kind of person would stop all booze? A teetotaler. A member of the (then prominent) temperance movement. A movement with such force that it ultimately did stop all booze, in the form of the 18th Amendment to the US Constitution, aka Prohibition (1917-1933).
So this sailor is worried the President has designs to end alcohol consumption in the United States.
losing my temperance for this answer
Ok, that's all great, but what does it tell us about this "cold water customer"?
First we need to analyze the syntax of that epithet. I read it as "adjective + customer", that is, it is using the colloquial (and now dated) sense of customer:
colloq. A person of a specified (esp. troublesome or difficult) character or type; (sometimes) spec. a person with whom one is dealing. Frequently with modifying adjective indicating personality or character, as awkward, ugly, etc. Also in extended use with reference to an animal, typically a fox, or an object.
cool customer: see the first element.
from the OED
That is, in "adjective + customer", we're saying "this is a person of type adjective", such as awkward, ugly, cool, etc.
So that leaves us with "cold water" as an adjective. What does that mean, and how does it relate to teetotalism and the President?
an icy shock
In the temperance movement, and all the discussion, debate, literature, and publications around it, alcohol (sinful) is constantly paired and contrasted with water (pure). In fact, it got so common to speak of this contrast, that Mark Twain famously inverted it (possibly apocryphal)¹:
Water, taken in moderation, cannot hurt anybody.
That is, if you can't drink booze, all you can drink is cold water. Bland, boring, completely uninspiring ... like a teetotaler. Like what the temperance people say is the only thing fit for Man to drink: cold water.
Like the President:
Houston is supposed to have once observed that Polk was "a victim of the use of water as a beverage."
The novel was written in 1849, and published in 1850, and set contemporaneously. The US president at the time was James K. Polk ... a teetotaler².
¹ And W. C. Fields put it more roughly: “Mr. Fields, could you tell me the reason for your well-known aversion to water?” ... “Never touch the stuff—very unhealthy. Fish fuck in it.”
² If you've gotten this far and still don't find "the alternative to booze is cold water" very convincing, perhaps there is some solace in knowing that, regardless of one's other choices of beverage, anyone who would stop another man's grog is, indisputably, a wet blanket.