Implementing lastInsertId for postgres

This commit is contained in:
José Lorenzo Rodríguez 2010-10-18 00:08:58 -04:30
parent 5c87daf083
commit ab9c8904ad

View file

@ -294,8 +294,7 @@ class DboPostgres extends DboSource {
*/
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);
}
/**