mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
BUG Use more robust logic to retrieve generated ID
This commit is contained in:
parent
2aadb9194b
commit
7de82cc6ca
@ -113,7 +113,7 @@ class PostgreSQLConnector extends DBConnector
|
|||||||
|
|
||||||
public function getGeneratedID($table)
|
public function getGeneratedID($table)
|
||||||
{
|
{
|
||||||
return $this->query("SELECT currval('\"{$table}_ID_seq\"')")->value();
|
return $this->query("SELECT currval(pg_get_serial_sequence('\"{$table}\"','ID'))")->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLastError()
|
public function getLastError()
|
||||||
|
Loading…
Reference in New Issue
Block a user