Git commits in Moodle 2.5.1 by Tim Lock

commit 992c0ec50db5e4f539a70bf6b116c154d07e8ea8
Author: Tim Lock <tim.lock@netspot.com.au>
Date:   Tue, 11 Jun 2013 07:24:01 +0800
Tag:    v2.5.1

MDL-40120: Fix get_course_records() which breaks in PSQL