? cvs_get_vanilla.sh ? database/.updates.inc.swp Index: database/updates.inc =================================================================== RCS file: /cvs/drupal/drupal/database/updates.inc,v retrieving revision 1.128 diff -u -p -r1.128 updates.inc --- database/updates.inc 16 Aug 2005 20:17:54 -0000 1.128 +++ database/updates.inc 18 Aug 2005 10:07:19 -0000 @@ -705,6 +705,26 @@ function update_145() { return $ret; } +/** + * Returns PostgreSQL database version. + * Currently only main and sub version are considered, but this can be extended if needed. + * Returns FALSE if it can not recognize the version. + */ +function drupal_pg_version() { + static $version = NULL; + + if ($version !== NULL) { + return $version; + } + + $result = db_result(db_query('SELECT version()')); + if (! $result or ! preg_match("/(\d+).(\d+)/", $result, $matches) ) { + return $version = FALSE; + } + + return $version = $matches; +} + function update_sql($sql) { $edit = $_POST["edit"]; $result = db_query($sql);