WASHINGTON - Congress enacted an election-year farm bill yesterday over President Bush's veto, sending new and bigger subsidies for farmers and more food stamps to help the poor with rising grocery prices.

The 82-13 vote in the Senate, which followed a 316-108 vote Wednesday night in the House, provided Democrats only their second veto override in Bush's presidency. But they harvested a constitutional controversy with it.

Not all of the bill that Congress passed last week is becoming law immediately. Because of a printing glitch, the version that Bush vetoed was missing 34 pages on international food aid and trade - a mistake that may require Congress to send yet another bill to the White House.

The president said the legislation was too expensive and too generous with subsidies for farmers who are already enjoying record-high prices and incomes.

The $290 billion bill increases food stamps by $1 billion a year. It also increases subsidies for some crops and for the first time subsidizes growers of fresh fruits and vegetables. All six Philadelphia-area senators voted for the farm bill. Among the three presidential candidates, Sen. Hillary Rodham Clinton voted for it. Sens. Barack Obama and John McCain did not vote.

The printing error turned a triumphant political victory into a vexing embarrassment for Democrats.

The party's leaders in the House decided to pass the bill again, including the missing section in the version that Bush got. That vote was 306-110, again enough to override another veto from Bush should the need arise.

Democratic leadership aides said the Senate would deal with the problem when Congress returns in June from a one-week vacation.

House Republicans used the error to plead Democratic incompetence. They complained that Bush vetoed a different bill from the one Congress passed, raising questions that the eventual law would be unconstitutional.

Senate Majority Leader Harry Reid (D., Nev.) said the process was entirely legal.

"We have, under good legal precedent, going back to a case I understand in 1892 where something like this happened before, it is totally constitutional," he said.

Robert B. Dove, a former Senate parliamentarian, agreed.

"It really doesn't matter what Congress actually does," he said. "All that matters is what goes to the president. The courts don't really want to get into the workings of Congress and try to figure out what the Congress really meant to do."

Bush has opposed the legislation from the start, threatening his first veto last July.