I recently migrated our trial Moodle 2.0 system from MySQL to PostgreSQL, via the experimental DB Transfer tool included in 2.0. Everything seemed to work fine, but I have noticed that we now see the occasional DB error when viewing logs via the admin UI.
I turned debugging on and found the following in my logs
[Sat Feb 12 21:21:53 2011] [error] Default exception handler: Error reading from database Debug: ERROR: function concat(character varying, unknown, character varying) does not exist at character 8\nHINT: No function matches the given name and argument types. You might need to add explicit type casts.\nSELECT CONCAT(firstname, ' ', lastname) FROM mdl_user WHERE id = $1\n[array (\n 0 => '21',\n)]\n* line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown\n* line 229 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()\n* line 669 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()\n* line 1256 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()\n* line 1331 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()\n* line 1310 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()\n* line 1289 of /lib/dml/moodle_database.php: call to moodle_database->get_field_select()\n* line 383 of /course/lib.php: call to moodle_database->get_field()\n* line 43 of /course/report/log/live.php: call to print_log()\n
Looking thru the issue tracker, MDL-23604 seems to match this problem: "Hard coded database CONCAT function causing errors". A patch for 2.0 was submitted and looks to correct the issue, but I have two questions:
1. Will the patch fix an existing install, or is it just for new installations? Has anyone tried it?
2. One of the comments on that issue suggests that the "log stuff is going to break db migrations" - has anyone else migrated 2.0 from MySQL to PostgreSQL? If so, have you run into any other problems?