In the coming months, President Obama will decide whether to approve the permit for the Keystone XL pipeline, which would transport crude tar-sands oil from Alberta to the Gulf of Mexico. We know that the pipeline would greatly aggravate climate change, allowing massive amounts of the world’s dirtiest oil to be extracted and later burned.

The payoff, say supporters such as the U.S. Chamber of Commerce, is a job boom in construction industries, which are currently suffering from high unemployment. Earlier this month, Chamber of Commerce CEO Tom Donohue called on the president “to put American jobs before special interest politics.”

If you believe headline-grabbing challenges such as Donohue’s, the president is painted into a corner on the KXL pipeline — trapped by a stagnant economy and an ailing environment.

The president knows KXL’s jobs promises are way overblown. In July, he explained it this way to The New York Times: “Republicans have said this would be a big jobs generator. There is no evidence that is true.” The most realistic estimates, said the president, show that KXL “might create maybe 2,000 jobs during the construction of the pipeline, which might take a year or two.” And after that, “we’re talking about somewhere between 50 and 100 jobs in an economy of 150 million working people.”

Still, even a few thousand construction jobs can’t be dismissed out of hand, in an industry where nearly a million people are estimated to be out of work. Those jobs would put food on the table and pay mortgages. They would alleviate a lot of pain, even if only temporarily. As a country, we’re still hungry for jobs. It seems as if we’re collectively out on the street and KXL is the only offer that has come along.

But that’s not actually the case.

According to “The Keystone Pipeline Debate: An Alternative Job Creation Strategy,” a study just released by Economics for Equity and Environment and the Labor Network for Sustainability, targeted investments in our existing water and natural-gas pipeline infrastructure needs along the proposed five-state corridor of the KXL pipeline would create many more long-term jobs than Keystone XL, both in absolute terms and per unit of investment.

We can create far more jobs in the construction industry and do it right in the regions that would stand to benefit from the KXL pipeline. We can get beyond the zombie jobs-vs.-environment debate that keeps rearing its ghoulish head, putting people back to work without breaking the climate. We can do all this by tackling the national crisis of aging infrastructure — repairing things such as crumbling water mains and leaking gas lines that are critical to our communities and our economy.

The data from the report are straightforward and compelling. Meeting the $18 billion in needed water and gas line repairs would support:

-  More than 300,000 total jobs across all sectors

-  Nearly five times more jobs, and more long-term jobs, than KXL

-  156 percent of the number of direct jobs created by Keystone XL per unit of investment

All of this necessary infrastructure work can be financed, as the report describes, just by closing three federal tax breaks fossil fuel companies enjoy for drilling and refining activities.  So the tax loopholes that would help subsidize the KXL pipeline could instead fund many more longer-lasting jobs repairing existing water and gas infrastructure.

To be clear, natural gas has serious negative impacts to communities and the environment. Fracking, the now commonly used process of extracting shale gas from deep underground, releases 30 percent more greenhouse gas emissions than conventional drilling and is poisoning water supplies across the country. But we still need to fix leaks in our existing natural-gas pipelines, which are contributing significantly to climate change. Shoring up those pipelines will also protect communities and businesses that rely on gas now, as we transition to cleaner energy.

Damage caused by leaking and unsafe gas pipelines cost governments across the country more than $450 million between 1984 and 2013. The American Society of Civil Engineers, in its latest Infrastructure Report Card, recently gave the country a D+ on energy infrastructure, and a D on drinking-water and wastewater infrastructure. If we don’t get our act together, we’re going to see more devastating explosions like the one that tore through San Bruno, Calif., a few years ago.

What’s curious is that many of the politicians and lobbying groups who have touted the KXL pipeline as a source of jobs have opposed legislation to invest in job-creating pipeline infrastructure programs. Yet when it comes to job creation, infrastructure improvements beat out KXL by a country mile. KXL has become a litmus test for being pro-job, but one that’s far detached from reality and that’s drawing attention away from effective ways to get people back to work.

Meanwhile, environmentalists, frequently excoriated as “job killers,” are becoming a strong collective voice for investment in infrastructure and other things our country really needs. They are increasingly working with organized labor to develop concrete alternatives to jobs that may destroy the environment.

If job creation is our primary goal, then politicians should pivot away from the Keystone XL pipeline and toward repairs to existing pipeline infrastructure. This is how President Obama — and the whole country — can get out of the Keystone jam.