From: stronk7 Date: Sun, 25 May 2008 02:38:30 +0000 (+0000) Subject: Changed postgresql sequence fetching to GetID. MDL-7183 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c97e8deb3ad3b475f933b51a960af9266db35bb3;p=moodle.git Changed postgresql sequence fetching to GetID. MDL-7183 --- diff --git a/lib/dml/postgres7_adodb_moodle_database.php b/lib/dml/postgres7_adodb_moodle_database.php index a2f8ab36a3..6ce794e702 100644 --- a/lib/dml/postgres7_adodb_moodle_database.php +++ b/lib/dml/postgres7_adodb_moodle_database.php @@ -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; } }