adding patch to dbo_postgres, #1828

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4395 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-02-02 00:06:26 +00:00
parent ce033247ed
commit 8f7add9c29

View file

@ -347,7 +347,13 @@ class DboPostgres extends DboSource {
* @return int
*/
function lastInsertId($source, $field = 'id') {
if(strpos($this->__descriptions[$source][0]['default'], 'nextval') === false) {
foreach ($this->__descriptions[$source] as $sourceinfo) {
if (strcasecmp($sourceinfo['name'], $field) == 0) {
break;
}
}
if(strpos($sourceinfo['default'], 'nextval') === false) {
return null;
}