Though the solar panel/pump is always 'on' the sun isn't always giving enough to actually move water. So also charging a battery isn't going to work.
Which leaves auto changing the power source as the only alternative.
I know I'll need to sense the power from the panel - and be able to fine tune the switching point
A relay to switch the source
a timer
What else ?