You are here

function dba_pgsql_report_version in Database Administration 7

Return current PostgreSQL version.

File

database/pgsql.report.inc, line 8

Code

function dba_pgsql_report_version() {
  $result = db_query("SELECT version()")
    ->fetch();
  preg_match('/(\\d{1,2})\\.(\\d{1,2})\\.(\\d{1,2})/', $result->version, $matches);
  array_shift($matches);
  $version = new dba_report_version($matches[0], $matches[1], $matches[2]);
  return $version;
}