--TEST-- PDO PgSQL Bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception when not in transaction) --EXTENSIONS-- pdo_pgsql --SKIPIF-- --FILE-- setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $pdo->beginTransaction(); try { $pdo->query("CREATE TABLE test67462 (a int NOT NULL PRIMARY KEY DEFERRABLE INITIALLY DEFERRED)"); $pdo->query("INSERT INTO test67462 VALUES (1), (1)"); var_dump($pdo->inTransaction()); $pdo->commit(); // This should fail! } catch (\Exception $e) { var_dump($pdo->inTransaction()); var_dump($pdo->beginTransaction()); } ?> --CLEAN-- query("DROP TABLE IF EXISTS test67462"); ?> --EXPECT-- bool(true) bool(false) bool(true)