Re: SQL-question: returning the id of an insert querry - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: SQL-question: returning the id of an insert querry
Date
Msg-id 20031112202032.GH30587@dcc.uchile.cl
Whole thread Raw
In response to Re: SQL-question: returning the id of an insert querry  (Scott Chapman <scott_list@mischko.com>)
List pgsql-general
On Wed, Nov 12, 2003 at 11:46:44AM -0800, Scott Chapman wrote:
> On Wednesday 12 November 2003 11:29, Doug McNaught wrote:
> >
> > Write a database function that inserts the record and returns the
> > primary key value?  That's probably the best way to insulate your app
> > from the database structure...
>
> The function still has to know which sequence to pull from doesn't it?

Yes, but it could pull it from the system catalogs ... (not too
portable)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"No necesitamos banderas
No reconocemos fronteras"                  (Jorge González)

pgsql-general by date:

Previous
From: Adam Ruth
Date:
Subject: Re: Column Sizes
Next
From: Alvaro Herrera
Date:
Subject: Re: pl/perl function life and variable scope - concurrency problem?