Req #72633 [Opn]: Postgres PDO lastInsertId() should work without specifying a sequence
Edit report at https://bugs.php.net/bug.php?id=72633&edit=1
ID: 72633
User updated by: zippy1981 at gmail dot com
Reported by: zippy1981 at gmail dot com
-Summary: lastInsertId() should work without specifying a
sequence
+Summary: Postgres PDO lastInsertId() should work without
specifying a sequence
Status: Open
Type: Feature/Change Request
Package: PDO PgSQL
Operating System: Any
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Changed title
Previous Comments:
------------------------------------------------------------------------
[2016-07-20 18:00:40] zippy1981 at gmail dot com
Description:
------------
The code here shows that CURRVAL() is used to get the last id of a named sequence but if NULL is
passed, NULL is returned.
https://github.com/php/php-src/blob/php-7.0.9/ext/pdo_pgsql/pgsql_driver.c#L360
However, as of postgres 8.3, the LASTVAL() function has been available to get the last sequence in a
session of any sequence. Postgres 8.2 EOL was in 2011.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72633&edit=1
Thread (3 messages)