Skip to content
Permalink
Browse files

Implementing lastInsertId for postgres

  • Loading branch information...
lorenzo committed Oct 18, 2010
1 parent 5c87daf commit ab9c8904adc65e7cdbd5c1aa06ca929a47d43eca
Showing with 1 addition and 2 deletions.
  1. +1 −2 cake/libs/model/datasources/dbo/dbo_postgres.php
@@ -294,8 +294,7 @@ function lastNumRows() {
*/
function lastInsertId($source, $field = 'id') {
$seq = $this->getSequence($source, $field);
$data = $this->fetchRow("SELECT currval('{$seq}') as max");
return $data[0]['max'];
return $this->_connection->lastInsertId($seq);
}
/**

0 comments on commit ab9c890

Please sign in to comment.
You can’t perform that action at this time.