Re: shorter way to get new value of serial?

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: shorter way to get new value of serial?
Date: 2005-11-18 18:05:15
Message-ID: 20051118180515.GB29354@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Nov 18, 2005 at 02:26:26PM +0100, Harald Armin Massa wrote:
> everything is fine. BUT: I feel that this a SO USUAL request (please, give
> me the new primary key of that just inserted beast), that there may be a
> simpler way, and I am just to blind to see.

See the currval() documents:

http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html

A
--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
This work was visionary and imaginative, and goes to show that visionary
and imaginative work need not end up well.
--Dennis Ritchie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2005-11-18 18:08:25 Re: How to debug a locked backend ?
Previous Message Martijn van Oosterhout 2005-11-18 17:58:41 Re: How to debug a locked backend ?