Index: includes/update.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/update.inc,v
retrieving revision 1.84
diff -u -p -r1.84 update.inc
--- includes/update.inc	18 Dec 2010 06:36:00 -0000	1.84
+++ includes/update.inc	27 Dec 2010 09:46:53 -0000
@@ -155,6 +155,23 @@ function update_prepare_d7_bootstrap() {
         'description' => $has_required_schema ? '' : 'Please update your Drupal 6 installation to the most recent version before attempting to upgrade to Drupal 7',
       ),
     );
+
+    // Make sure that the database environment is properly set up.
+    try {
+      db_run_tasks(db_driver());
+    }
+    catch (DatabaseTaskException $e) {
+      // These are generic errors, so we do not have any specific key of the
+      // database connection array to attach them to; therefore, we just put
+      // them in the error array with standard numeric keys.
+      $requirements[$driver] = array(
+        'title' => 'Database environment',
+        'value' => 'There is a problem with your database environment',
+        'severity' => REQUIREMENT_ERROR,
+        'description' => $e->getMessage(),
+      );
+    }
+
     update_extra_requirements($requirements);
 
     // Allow a D6 session to work, since the upgrade has not been performed yet.
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.530
diff -u -p -r1.530 system.install
--- modules/system/system.install	18 Dec 2010 00:43:04 -0000	1.530
+++ modules/system/system.install	27 Dec 2010 09:46:57 -0000
@@ -2115,21 +2115,6 @@ function system_update_7021() {
 }
 
 /**
- * Add the substr_index() function to PostgreSQL.
- *
- * Note: this should go into the driver itself, but we have no support
- * for driver-specific updates yet.
- */
-function system_update_7024() {
-  if (db_driver() == 'pgsql') {
-    db_query('CREATE OR REPLACE FUNCTION "substring_index"(text, text, integer) RETURNS text AS
-      \'SELECT array_to_string((string_to_array($1, $2)) [1:$3], $2);\'
-      LANGUAGE \'sql\''
-    );
-  }
-}
-
-/**
  * Enable field type modules.
  */
 function system_update_7027() {
