Can the Arduino do this - power source switch

Is the pump always on (assuming full power from the solar cells) during daylight hours?
If not, have you thought about a storage device (rechargeable battery) to be charged when the pump is not on?
You could then recharge the battery overnight from the transformer.
All you'd need is a mains time switch to turn the transformer on and off (at dusk and dawn), a relay to disconnect the pump while the battery is being charged from the mains and a diode to stop the battery from holding the relay in when the transformer switches off.