WHEN WAS the last time an American president stood before an audience in a foreign country and announced that he looked forward to importing more of its oil? Answer: Just over a week ago, when President Obama joined political and business leaders in Brasilia in hailing the fact that their newly discovered offshore petroleum reserves might be twice as large as those in the United States. Americans “want to help with technology and support to develop these oil reserves safely, and when you’re ready to start selling, we want to be one of your best customers,” Mr. Obama said.

Brazil is probably a more stable, secure supplier than, say, Libya. Still, the president’s words were ironic. Brazil already produces vast quantities of a fuel — ethanol — that the U.S. government, under a policy long supported by presidents and farm-state members of Congress from both parties, has promoted as a green alternative to gasoline. But the United States, protecting its own heavily subsidized ethanol industry by means of a 2.5 percent tariff and a 54-cent-per-gallon duty, prevents Americans from importing all but trivial amounts of the stuff from Brazil. Therefore, we need more oil — much of it imported. In Brasilia, Mr. Obama spoke of strengthening U.S.-Brazilian technical cooperation on ethanol but did not propose allowing U.S. protectionist measures to lapse after their scheduled expiration on Dec. 31.

As for offshore drilling, Mr. Obama’s enthusiasm for punching holes in the ocean floor off Brazil is hard to reconcile with his decision, announced Dec. 1, to keep the waters off the East and West coasts and the eastern Gulf of Mexico off-limits to exploration indefinitely. His policy was a reversal of an earlier decision he had made to open some of those areas. We can understand that reversal, after the massive oil spill in the western Gulf last year. And, demonstrating a measure of flexibility even after the disaster, the administration has announced five deep-water drilling permits in the western Gulf since the spill.

The vast majority of U.S. shores, however, have remained off-limits for decades. This, too, is a policy made by two parties, with Republicans opposing drilling when it suited them; President George W. Bush prevented drilling off the Florida Gulf Coast in part to boost his brother Jeb’s 2002 run for a second term as governor. But it is tough to reconcile with U.S. eagerness to “help” Brazil pump oil off its coasts and ship it here. U.S. companies, enticed by government loan guarantees, are already lined up to sell Brazil drilling equipment and services. Forget the implications for U.S. dependency on foreign sources. What does this posture say about American regard for the natural environment outside U.S. territory?

Privileged residents of scenic landscapes in America have long cried “NIMBY” — “Not In My Back Yard” — to stave off unwanted but necessary projects, from railway tracks to wind farms to power lines. Now NIMBY-ism, it seems, has become U.S. policy on offshore oil production. But the Nigerias, Angolas and Brazils of the world do not have that luxury. This makes no sense, economically or environmentally, and, sooner or later, a more balanced view must prevail.