getting back "rowid" after an insert...
От | Mark Dzmura |
---|---|
Тема | getting back "rowid" after an insert... |
Дата | |
Msg-id | 39B70050.76E3EB0C@digital-mission.com обсуждение исходный текст |
Список | pgsql-interfaces |
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!! ((((
Вложения
В списке pgsql-interfaces по дате отправления: