* TSX rises 87.18, or 0.62 pct, to 14,087.18
* Eight of the 10 main groups higher
* Materials rise 2.8 pct, led by golds (Updates with details, comments)
By Cameron French
TORONTO, March 23 (Reuters) - Toronto's main stock index climbed to a two-week high on Wednesday, driven up by financial issues and gold stocks, while energy stocks weighed on the market.
Gold was helped by safe-haven buying that pushed bullion to within a whisker of its record high of $1,444.40 an ounce. Disappointing U.S. housing data, tensions in oil-producing countries, and fears that a crucial vote in Portugal could topple the government all fueled the flight to safety.
The TSX materials sector charged ahead 2.8 percent, led by shares of the world's top two gold producers by market capitalization. Barrick Gold ABX.TO rose 3.7 percent to C$51.05, while Goldcorp G.TO climbed 3.6 percent to C$48.84.
Silver prices charged to a 31-year high above $37 an ounce, which also boosted gold miners.
"The continued turmoil, especially the developments we've seen since the beginning of this year, they kind of support the thesis that gold prices will continue to rise," said Elvis Picardo, an analyst and strategist at Global Securities in Vancouver.
The Toronto Stock Exchange's S&P/TSX composite index .GSPTSE ended the session up 87.18 points, or 0.62 percent, at 14,087.18. Eight of the index's 10 subgroups rose.
The index's heavily weighted financial sector rose 0.44 percent, led by Canadian Imperial Bank of Commerce CM.TO, up 1.4 percent at C$85.49, and Toronto-Dominion Bank TD.TO, which rose 0.8 percent to C$85.22.
The TSX energy group sagged 0.7 percent.
($1=$0.98 Canadian) (Reporting by Cameron French; editing by Peter Galloway)