AS LONG AS YOU LIKE. David Ignatius, aiming to make me love Don Rumsfeld by arguing that he should resign in order to increase public support for the indefinite continuation of the Iraq War, observes that "As bad as things are in Baghdad, America won't be defeated there militarily. But it may be forced into a hasty and chaotic retreat by mounting domestic opposition to its policy." This is one of the truthiest of all elements of the elite conventional wisdom on Iraq. Yes, it's true, insurgents aren't going to inflict some kind of decisive battlefield loss on the US Army. Insofar as the American government wants to continue the occupation of Iraq, we will be able to do so forever. But it's worth recalling that forever is a long time. For example, in Chechnya, "the current resistance to Russian rule began during the late 18th century (1785-1791) as a result of Russian expansion into territories formerly under the dominion of Turkey and Persia." For comparison's sake, note that the American Revolutionary War ended in 1783.
There's a kind of funny notion in American circles that it's somehow cheating for states or organizations that lack the $11 trillion economy and 300 million strong population of the United States to refuse to stand up and fight honorably against American tanks and airplanes capable of slaughtering them from long range, or that somehow a defeat doesn't count unless it's inflicted by somebody breaking all our tanks. But nothing in the world works like this. No nationalist insurgency has ever inflicted a "military defeat" on the foreign power it's trying to expel (American Revolutionary War, again) and they invariably win anyway.