From 4b5732f987abc3d9a3beadda597dcec3904ed469 Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 3 Jun 2009 20:53:19 +0000 Subject: [PATCH] MDL-17020 pg 8.3 required, no need for legacy hacks anymore :-D --- lib/dml/pgsql_native_moodle_database.php | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/lib/dml/pgsql_native_moodle_database.php b/lib/dml/pgsql_native_moodle_database.php index 61d078e26f..a2999a873d 100644 --- a/lib/dml/pgsql_native_moodle_database.php +++ b/lib/dml/pgsql_native_moodle_database.php @@ -689,22 +689,8 @@ class pgsql_native_moodle_database extends moodle_database { $returnid = false; } else { if ($returnid) { - if ($this->is_min_version('8.2.0')) { - $returning = "RETURNING id"; - unset($params['id']); - } else { - //ugly workaround for pg < 8.2 - $seqsql = "SELECT NEXTVAL('{$this->prefix}{$table}_id_seq') AS id"; - $this->query_start($seqsql, NULL, SQL_QUERY_AUX); - $result = pg_query($this->pgsql, $seqsql); - $this->query_end($result); - if ($result === false) { - throw new dml_exception('missingidsequence', "{$this->prefix}{$table}"); // TODO: add localised string - } - $row = pg_fetch_assoc($result); - $params['id'] = reset($row); - pg_free_result($result); - } + $returning = "RETURNING id"; + unset($params['id']); } else { unset($params['id']); } @@ -1075,7 +1061,7 @@ class pgsql_native_moodle_database extends moodle_database { /// session locking public function session_lock_supported() { - return $this->is_min_version('8.2.0'); + return true; } public function get_session_lock($rowid) { -- 2.39.5