| От | Jan Danielsson |
|---|---|
| Тема | Last Id? |
| Дата | |
| Msg-id | 431B368B.6010109@gmail.com обсуждение исходный текст |
| Ответы |
Re: Last Id?
Re: Last Id? |
| Список | pgsql-novice |
Hello all, I know how do do this in IBM DB2 and MySQL, but now my interrest has shifted towards postgresql; I need to be able to insert a row, and find out which id it was assigned. (I'm talking about using sequences here). I have seen a few "currval", "last_value", tricks and such, but they aren't good enough, AFAICT, since they only work when I can guarantee that no one else will insert a new record between the time that I insert one, and query for the last_value. In IBM DB2 and MySQL there's a connection specific "last id" value which can be queried. I assume there's something similar in postgresql -- but what is it? -- Kind Regards, Jan Danielsson Te audire no possum. Musa sapientum fixa est in aure.
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера