Issue #2938871 by Graber, mhavelant: IntegrityConstraintViolationException due to ambiguous column in query