Permalink
Browse files

MDL-37420 rework pg schema (partial backport take2)

  • Loading branch information...
1 parent fa02465 commit 0eda863c21d4e44ffde20b10119286fa86ec444a @stronk7 stronk7 committed Jan 11, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 enrol/database/tests/adodb_test.php
@@ -67,7 +67,11 @@ public function test_read_table() {
case 'pgsql_native_moodle_database':
set_config('dbtype', 'postgres7', 'enrol_database');
- set_config('dbsetupsql', 'SET NAMES \'UTF-8\'', 'enrol_database');
+ $setupsql = "SET NAMES 'UTF-8'";
+ if (!empty($CFG->dboptions['dbschema'])) {
+ $setupsql .= "; SET search_path = '".$CFG->dboptions['dbschema']."'";
+ }
+ set_config('dbsetupsql', $setupsql, 'enrol_database');
set_config('dbsybasequoting', '0', 'enrol_database');
if (!empty($CFG->dboptions['dbsocket']) and ($CFG->dbhost === 'localhost' or $CFG->dbhost === '127.0.0.1')) {
if (strpos($CFG->dboptions['dbsocket'], '/') !== false) {

0 comments on commit 0eda863

Please sign in to comment.