Issue #1003788 by stefan.r, Alan D., JimmyAx, Josh Waihi, john_brown, bellHead, twistor, wiifm, bzrudi71, pwolanin, gngn, Gisle, robhardwick: Fixed PostgreSQL: PDOException:Invalid text representation when attempting to load an entity with a string or non-scalar ID.