At certain points, God seems less omniscient than he is generally believed to be. This is Genesis 18:20-21:
God doesn't know whether the reports are true, and has to go and take a look?
However. Here God seems to be talking to Abraham. It's conceivable that this is just a metaphor he uses to convey that which cannot be comprehended: the inner workings of God's mind. How plausible this is I don't know - the natural reading is that God, indeed, does not yet know but needs to go and find out.
A likely explanation is the existence in Genesis of myths from different authors with different understandings of the power of God.