From: Mark Dzmura <mdz@digital-mission.com>
To: pgsql-interfaces@postgreSQL.org <pgsql-interfaces@postgreSQL.org>
Subject: getting back "rowid" after an insert...
Date: Wed, 06 Sep 2000 22:41:20 -0400
Message-ID: <39B70050.76E3EB0C@digital-mission.com> (raw)
I have the exact same issue as Alec, below, except it's even worse: in some of my situations,
I can't even do a meaningful query to get the record I just inserted, since there is no unique key
other than the "serial" primary key obtained from the sequence...
I can think of a couple of ways to get the most recent transaction (get the value from the
sequence, or do a select id order by timestamp desc limit 1), but would have to guarantee
atomicity to get the data corresponding to the row I just inserted...I could use a transaction
just to guarantee that no records are added between my insert and my select, but that seems
like a horrendous waste (since so many databases are ready to just hand me a rowid or oid
after an insert...)
Can anybody help us out here??
Regards,
Mark Dzmura
>> Hi,
>>
>> It appears that the JDBC insert row feature has not been implemented. Is there any news on when this is planned?
>>
>> I was planning on using this feature to determine the value of an automatically-assigned primary key column when a
>> single row is inserted without having to do a query following the insertion, although I'm not sure if default
>> values are assigned to the insert row according to the JDBC spec. Is there an easy way to do this without the
>> insert row feature?
--
)))) This email routed via a wireless gateway!! ((((
Attachments:mdz.vcf (text/x-vcard, 279B) download
begin:vcard
n:Dzmura;Mark
tel;fax:412-429-3361
tel;work:412-429-6001
x-mozilla-html:FALSE
org:Digital Mission, LLC
adr:;;230 E. Main St., Suite 210;Carnegie;PA;15106;USA
version:2.1
email;internet:mdz@digital-mission.com
title:President
x-mozilla-cpt:;0
fn:Mark Dzmura
end:vcard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: mdz@digital-mission.com
Subject: Re: getting back "rowid" after an insert...
In-Reply-To: <39B70050.76E3EB0C@digital-mission.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox