system_update_7024

Versions
7
system_update_7024()

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.

Related topics

Code

modules/system/system.install, line 2318

<?php
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\''
    );
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.