Skip to content

Commit

Permalink
Merge pull request #148 from creative-commoners/pulls/3.0/better-get-…
Browse files Browse the repository at this point in the history
…generated-id-logic

BUG Use more robust logic to retrieve generated ID
  • Loading branch information
GuySartorelli authored Jun 29, 2023
2 parents 2aadb91 + 7de82cc commit 4608fd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/PostgreSQLConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function affectedRows()

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()
Expand Down

0 comments on commit 4608fd7

Please sign in to comment.