| От | Csaba Nagy |
|---|---|
| Тема | Re: INSERT and get ID |
| Дата | |
| Msg-id | 1122471632.2837.79.camel@coppola.muc.ecircle.de обсуждение |
| Ответ на | Re: INSERT and get ID (Peter.Zoche@materna.de) |
| Список | pgsql-jdbc |
It will be perfectly safe, as curval will return you the last value
created in the current session. So you can be sure it's your value
unless you use the same connection concurrently in different threads,
but in that case you would have bigger problems :-)
Cheers,
Csaba.
On Wed, 2005-07-27 at 15:29, Peter.Zoche@materna.de wrote:
> > You have to do a a "SELECT curval('myseq')" after the insert.
>
> I had this in mind, too, but I am not sure if it is really safe if
> there are several inserts at the same time...
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
В списке pgsql-jdbc по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера