CANADA STOCKS-Investors seek refuge in Toronto market as Wall Street tumbles

(Adds investor quotes and details throughout, updates prices)

* TSX ends down 35.58 points, or 0.2%, at 19,222.74

* Technology falls 2.2%

* Energy jumps 4.2%; oil settles 2% higher

By Fergal Smith

TORONTO, June 28 (Reuters) - Canada's main stock index edged lower on Tuesday as data showing a drop in U.S. consumer confidence weighed on investor sentiment, but gains for the energy sector helped shield the market from deeper losses.

The Toronto Stock Exchange's S&P/TSX composite index ended down 35.58 points, or 0.2%, at 19,222.74, but holding on to much of its gains over the previous two days.

"The TSX has been a nice hiding spot today," said Greg Taylor, a portfolio manager at Purpose Investments. "It feels that a lot of pain in the markets has been in the tech stocks, which are really pulling back from the bounce they had last week."

Wall Street slid on the heels of dire consumer confidence data, which dampened investor optimism and stoked recession fears.

The Toronto market's technology sector fell 2.2%, while the materials group, which includes precious and base metals miners and fertilizer companies, ended 1.6% lower.

In contrast, energy rallied 4.2%, gaining for a third straight day, as U.S. crude oil futures settled 2% higher at $111.76 a barrel.

Supportive of oil, major producers Saudi Arabia and the United Arab Emirates looked unlikely to be able to boost output significantly while Western governments agreed to explore ways to cap the price of Russian oil.

The rally for energy in recent days offers "a glimmer of hope that the TSX can go back to outperforming some of the global markets," Taylor said.

The Toronto market has had a volatile second quarter. Still, its decline of 9.4% since the start of the year is much less than for U.S. benchmark the S&P 500. (Reporting by Fergal Smith; Additional reporting by Amal S in Bengaluru; Editing by Sandra Maler)