Re: getting a sequence value

Поиск
Список
Период
Сортировка
От Guillaume Cottenceau
Тема Re: getting a sequence value
Дата
Msg-id 87acoxuqcn.fsf@meuh.mnc.ch
обсуждение исходный текст
Ответ на Re: getting a sequence value  (Dave Cramer <pg@fastcrypt.com>)
Ответы Re: getting a sequence value  (Dave Cramer <pg@fastcrypt.com>)
Список pgsql-jdbc
Dave Cramer <pg 'at' fastcrypt.com> writes:

> 2)
> allow the insert to go through
> select currval('public."tblTable1_FieldID_seq"'::text)
> and then use this to insert into table 2
>
> FYI currval does the "right" thing. It is guaranteed to be the value
> your connection retrieved from the sequence.

Which can be wrong in case of multithreaded applications without
synchronization over the two requests, if I'm correct.

--
Guillaume Cottenceau

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: getting a sequence value
Следующее
От: Roland Walter
Дата:
Сообщение: Re: getting a sequence value