Re: How I can read-back a serial value just inserted?

From: Devrim GUNDUZ <devrim(at)CommandPrompt(dot)com>
To: Russ Brown <pickscrape(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How I can read-back a serial value just inserted?
Date: 2007-01-18 16:06:06
Message-ID: 1169136366.3236.25.camel@laptop.gunduz.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

On Thu, 2007-01-18 at 10:01 -0600, Russ Brown wrote:
> lastval's main benefit is in aiding the port of MySQL apps (being a
> drop-in replacement for LAST_INSERT_ID()). without lastval such ports
> can be really difficult.

I think one can also use INSERT/UPDATE...RETURNING that appeared in 8.2.

Regards,

--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-01-18 16:12:54 Re: Ask about large database?
Previous Message Russ Brown 2007-01-18 16:01:56 Re: How I can read-back a serial value just inserted?