note 97298 deleted from pdo.lastinsertid by danbrown
| From: | danbrown@php.net | Date: | Tue, 13 Apr 2010 14:06:45 +0000 |
| Subject: | note 97298 deleted from pdo.lastinsertid by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168202@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
re: the PostgreSQL sequence RETURNING currval('blah_id_seq')
I found that "INSERT ... RETURNING lastval()" is a nicer solution, because you
don't have to worry/remember the sequence name.
(I wouldn't expect this would work if the insert query updated multiple sequences though)