From 7de82cc6ca12fb6b986c821fd8c5292ad7cf7882 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Wed, 28 Jun 2023 14:24:27 +1200 Subject: [PATCH] BUG Use more robust logic to retrieve generated ID --- code/PostgreSQLConnector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/PostgreSQLConnector.php b/code/PostgreSQLConnector.php index 2ccfa19..8fa064b 100644 --- a/code/PostgreSQLConnector.php +++ b/code/PostgreSQLConnector.php @@ -113,7 +113,7 @@ class PostgreSQLConnector extends DBConnector 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()