Skip site navigation (1) Skip section navigation (2)

Re: MySQL LAST_INSERT_ID() to Postgres

From: Christophe <xof(at)thebuild(dot)com>
To: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: MySQL LAST_INSERT_ID() to Postgres
Date: 2008-08-28 22:29:25
Message-ID: 3AC6F20E-8EEA-425B-BD77-66B350FD2C93@thebuild.com (view raw or flat)
Thread:
Lists: pgsql-general
On Aug 28, 2008, at 3:23 PM, D. Dante Lorenso wrote:
> I use RETURNING for all my insert and UPDATE statements now.   
> Usually I'll return the primary key for the table, but sometimes I  
> return a column that is created by one of my triggers.  It's  
> awesome to be able to do this in one query.
>

Word.  My current pet architecture is to set up Postgres like an  
application server (the web front end just call PL/pgSQL stuff rather  
than doing direct SQL), and this makes my life much easier for that.

In response to

pgsql-general by date

Next:From: BillDate: 2008-08-28 22:29:51
Subject: Re: MySQL LAST_INSERT_ID() to Postgres
Previous:From: Matthew DennisDate: 2008-08-28 22:25:49
Subject: Re: indexes on functions and create or replace function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group