Skip to content

Commit 7de82cc

Browse files
author
Maxime Rainville
committed
BUG Use more robust logic to retrieve generated ID
1 parent 2aadb91 commit 7de82cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/PostgreSQLConnector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function affectedRows()
113113

114114
public function getGeneratedID($table)
115115
{
116-
return $this->query("SELECT currval('\"{$table}_ID_seq\"')")->value();
116+
return $this->query("SELECT currval(pg_get_serial_sequence('\"{$table}\"','ID'))")->value();
117117
}
118118

119119
public function getLastError()

0 commit comments

Comments
 (0)