relay powered voltage regulator ?

So does the diode protect the relay coil from transient spikes?