Re: SEQUENCE primary key

From: Chris <dmagick(at)gmail(dot)com>
To: John McCawley <nospam(at)hardgeus(dot)com>
Cc: gustavo halperin <ggh(dot)develop(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: SEQUENCE primary key
Date: 2007-02-14 02:06:46
Message-ID: 45D26EB6.9090500@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

John McCawley wrote:
> In PostgreSQL 8 and up:
>
> SELECT lastval();

Actually it's better to use currval.

See
http://people.planetpostgresql.org/xzilla/index.php?/archives/169-Is-lastval-evil.html

--
Postgresql & php tutorials
http://www.designmagick.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-02-14 02:20:48 Re: SEQUENCE primary key
Previous Message John McCawley 2007-02-14 01:09:26 Re: SEQUENCE primary key