If you can tolerate a 0.7V voltage drop a simple way is to connect each to the load through diodes. You need to have the power supply voltage slightly higher than the battery so the power supply powers the load during normal operation.
If the power supply can tolerate a voltage on its terminals when off and it doesn't draw signficant current, you only need one diode at the battery out.
If you don't want the diode voltage drop then you need a more elaborate switching scheme that can control transistors to switch from one source to the other. For example the intersil ICL7673 is an IC that will switch on the higher of two voltages to the load through PNP transistors.