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

From Andrew Sullivan
Subject Re: SQL-question: returning the id of an insert querry
Date
Msg-id 20031112115110.GD20800@libertyrms.info
Whole thread Raw
In response to Re: SQL-question: returning the id of an insert querry  (Scott Chapman <scott_list@mischko.com>)
Responses Re: SQL-question: returning the id of an insert querry  (Scott Chapman <scott_list@mischko.com>)
List pgsql-general
On Mon, Nov 10, 2003 at 08:56:03AM -0800, Scott Chapman wrote:
> I talked with the author or SQLObject about this recently and I thnk
> he's implementing this correctly, by querying the cursor for the last
> OID?:

That won't scale unless you index oid.  And your tables will all need
oids, which is not standard any more.

If you do your work in one transaction and get the currval that way,
it is impossible to go wrong.  Also, if you don't return the
connection to the pool before getting the currval, you will not go
wrong.

A

--
----
Andrew Sullivan                         204-4141 Yonge Street
Afilias Canada                        Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110


pgsql-general by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: Problem with FKEYS
Next
From: Christopher Murtagh
Date:
Subject: Re: plperl/createlang issue