]> git.mjollnir.org Git - moodle.git/commitdiff
Changed postgresql sequence fetching to GetID. MDL-7183
authorstronk7 <stronk7>
Sun, 25 May 2008 02:38:30 +0000 (02:38 +0000)
committerstronk7 <stronk7>
Sun, 25 May 2008 02:38:30 +0000 (02:38 +0000)
lib/dml/postgres7_adodb_moodle_database.php

index a2f8ab36a375aac9571b65a3de646af110190d4a..6ce794e7023afc9a690e5d549ecbbb49a8b9bdd9 100644 (file)
@@ -151,6 +151,7 @@ class postgres7_adodb_moodle_database extends adodb_moodle_database {
 
     /**
      * Insert new record into database, as fast as possible, no safety checks, lobs not supported.
+     * (overloaded from adodb_moodle_database because of sequence numbers
      * @param string $table name
      * @param mixed $params data record as object or array
      * @param bool $returnit return it of inserted record
@@ -169,7 +170,8 @@ class postgres7_adodb_moodle_database extends adodb_moodle_database {
         }
         unset($params['id']);
         if ($returnid) {
-            if ($nextval = $this->get_field_sql("SELECT NEXTVAL('{$this->prefix}{$table}_id_seq')")) {
+            $seqname = "{$this->prefix}{$table}_id_seq";
+            if ($nextval = $this->db->GenID($seqname)) {
                 $params['id'] = (int)$nextval;
             }
         }