UPDATE: Federal budget offers money for job retraining and home incentives

The federal Liberal government is spending billions of dollars on everything from pharmacare to helping workers learn new job skills to easing the burden on first-time home buyers in its final budget before voters go to the polls in October.

Prime Minister Justin Trudeau's government, which is bringing in more money than forecast, is spending all that and then some, projecting a $19.8-billion deficit for the 2019-20 fiscal year.

That's $200 million more borrowing than anticipated in a year that was supposed to see the federal books deliver a surplus, according to the Liberal election platform from the 2015 campaign.

Finance Minister Bill Morneau says the government needs to deal with what he calls growing concern around the world that good jobs won't last, children will be worse off than their parents and that living longer will mean a crushing financial burden.

So it's sprinkling billions of dollars across a variety of programs meant to help people at every stage of their lives.

The budget's single biggest-ticket item, however, is nearly $4 billion in aid for dairy and poultry farmers impacted by new free-trade deals.

Here are the highlights:

$1.7 billion over five years, and $586 million a year after that, for a Canada Training Benefit to help workers upgrade skills and acquire new ones while keeping their jobs. The benefit includes a $250-a-year tax credit to pay for training programs and access to employment insurance to cover living expenses for up to four weeks away from work.

$1.18 billion over five years to toughen border security, including hiring more judges to handle judicial reviews of asylum applications.

Measures to make housing more affordable, especially for first-time buyers, by letting them borrow $35,000 from RRSPs (up from $25,000) and having the Canada Mortgage and Housing Corp. contribute a small share of equity for down payments.

A federal deficit of $19.8 billion, including a $3-billion ``risk adjustment,'' an increase of $200 million from last year's forecast. The Liberals' forecast again includes a gradual reduction in the deficit, but not quite as quickly as anticipated last year. By 2023-2024, the projected federal deficit is $11.4 billion.

$3.9 billion for farmers in supply-managed industries affected by new trade agreements with the United States and Asian countries.

$2.2 billion for municipalities' and First Nations' infrastructure projects, through a one-time boost to the amount distributed through the federal gas-tax transfer.

$1.2 billion over three years to enhance social services for Indigenous families and children, the main element in a package of spending aimed at Indigenous Peoples.

Lowering the interest rate on Canada Student Loans to the prime rate, from the current prime-plus-2.5-percentage-points.

Creating a new Canadian Drug Agency to centralize the evaluations of the effectiveness and efficiency of new drugs and buy in bulk nationwide, instead of province-by-province.

$500 million a year, starting in 2022, to subsidize the costs of drugs for rare diseases, whose high costs are distributed among very few patients.

$300 million over three years for rebates of up to $5,000 on electric or hydrogen-fuel-cell vehicles (with a maximum purchase price of $45,000).

$950 million for municipal governments to refit their own buildings for energy efficiency and to provide their own subsidy programs for private homeowners to do the same.

$50 million over five years to devise a new national dementia strategy.