[UPHPU] Postgres Insert ID
Lonnie Olson
lists at kittypee.com
Thu Oct 23 14:59:57 MDT 2008
On Thu, Oct 23, 2008 at 2:39 PM, Sean Thayne <sean at exit12.org> wrote:
> Interesting... I was looking into a couple of frameworks (codeignitor,
> symphony, cake) and they all use either LASTVAL() or CURRVAL for their last
> insert id's
Cool, looks like I am wrong.
http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html
LASTVAL and CURVAL are session specific. That means the race
condition doesn't apply.
You can just use LASTVAL() in your application.
--lonnie
More information about the UPHPU
mailing list