Req #72633 [Opn->Csd]: Postgres PDO lastInsertId() should work without specifying a sequence

From: Date: Wed, 27 Jul 2016 21:51:34 +0000
Subject: Req #72633 [Opn->Csd]: Postgres PDO lastInsertId() should work without specifying a sequence
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202648@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72633&edit=1

 ID:                 72633
 Updated by:         ab@php.net
 Reported by:        zippy1981 at gmail dot com
 Summary:            Postgres PDO lastInsertId() should work without
                     specifying a sequence
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
 Package:            PDO PgSQL
 Operating System:   Any
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        ab
 Block user comment: N
 Private report:     N

 New Comment:

Implemented via https://github.com/php/php-src/pull/2014

Thanks.


Previous Comments:
------------------------------------------------------------------------
[2016-07-20 18:49:21] zippy1981 at gmail dot com

Changed title

------------------------------------------------------------------------
[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)

« previous php.bugs (#202648) next »