mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 15:05:45 +00: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)
|
public function getGeneratedID($table)
|
||||||
{
|
{
|
||||||
$result = $this->query("SELECT last_value FROM \"{$table}_ID_seq\";")->first();
|
$result = $this->query("SELECT currval('\"{$table}_ID_seq\"')")->first();
|
||||||
return $result['last_value'];
|
return $result['currval'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLastError()
|
public function getLastError()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user