mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
Merge pull request #77 from Rudigern/insert-concurrency-issue
getGeneratedID to use currval() which is session dependent
This commit is contained in:
commit
8c5f95fdaa
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user