Re: SQL-question: returning the id of an insert querry

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL-question: returning the id of an insert querry
Date: 2003-11-12 11:51:11
Message-ID: 20031112115110.GD20800@libertyrms.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)libertyrms(dot)info> M2P 2A8
+1 416 646 3304 x110

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2003-11-12 13:08:23 Re: [HACKERS] Proposal for a cascaded master-slave replication system
Previous Message Rajesh Kumar Mallah 2003-11-12 11:06:21 Problem with FKEYS