-
Bug
-
Resolution: Fixed
-
Major
-
2.1, 2.2
-
PostgreSQL
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_21_STABLE
-
To create a handle to an external postgres database, you must call
$foo = moodle_database::get_driver_instance('pgsql', 'native')
This in turn determines the relevant class, and returns a new instance of that class.
Moodle requires that you define a table prefix if you're using postgres for the Moodle database, but the postgres driver drops this requirement if $this->external is true.
The only way of setting the external flag is through the constructor, but since the instance is instantiated via the get_driver_instance, this is not possible.