Merge pull request #77 from Rudigern/insert-concurrency-issue

getGeneratedID to use currval() which is session dependent
This commit is contained in:
Damian Mooyman 2017-10-20 18:47:01 +13:00 committed by GitHub
commit 8c5f95fdaa

View File

@ -116,8 +116,8 @@ class PostgreSQLConnector extends DBConnector
public function getGeneratedID($table)
{
$result = $this->query("SELECT last_value FROM \"{$table}_ID_seq\";")->first();
return $result['last_value'];
$result = $this->query("SELECT currval('\"{$table}_ID_seq\"')")->first();
return $result['currval'];
}
public function getLastError()