|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73959 lastInsertId fails to throw an exception
Submitted: 2017-01-19 10:36 UTC Modified: -
From: david dot hedberg at zavann dot se Assigned:
Status: Closed Package: PDO PgSQL
PHP Version: 7.0.14 OS: Ubuntu 16.04
Private report: No CVE-ID: None
 [2017-01-19 10:36 UTC] david dot hedberg at zavann dot se
Running PDO::lastInsertId() using a bad sequence name (not updated or nonexistent) no longer throws an exception after upgrading.

PostgreSQL server version is 9.5.5.

It works in 7.0.8-0ubuntu0.16.04.3, but fails in both 7.0.13-0ubuntu0.16.04.1 and

Test script:
$pdo = new PDO(
    'pgsql:service=...', null, null,
        PDO::ATTR_PERSISTENT => false,

try {
    echo "Error: No exception thrown";
} catch (PDOException $e) {
    echo "Success: Exception thrown";

Expected result:
Success: Exception thrown

Actual result:
Error: No exception thrown


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-20 15:02 UTC] andrew dot nester dot dev at gmail dot com
I've just added PR to fix this problem. Please review it on GitHub.
 [2017-01-20 20:12 UTC]
Automatic comment on behalf of
Log: Fixed #73959 - lastInsertId fails to throw an exception in pdsql
 [2017-01-20 20:12 UTC]
-Status: Open +Status: Closed
 [2017-01-21 09:09 UTC] david dot hedberg at zavann dot se
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Jun 08 19:03:36 2023 UTC