The Andrews government has approved a trial run of a safe injecting room for heroin addicts.

Key upper house MP James Purcell confirmed on Monday that his vital vote would go with legislation to enable a state-sanctioned injecting room in the inner-city neighbourhood of Richmond, where dozens of lives have been lost to heroin overdoses in recent years.

If established, the injecting room would be the first in Victoria, and only the second in Australia, after NSW established one in Kings Cross in 2001.

It's believed the trial would run for at least two years, followed by a review.