Re: get a pkey/id back from/after an insert

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: get a pkey/id back from/after an insert
Дата
Msg-id 20060620163403.GA7486@wolff.to
обсуждение исходный текст
Ответ на Re: get a pkey/id back from/after an insert  (Richard Broersma Jr <rabroersma@yahoo.com>)
Ответы Re: get a pkey/id back from/after an insert  (Richard Broersma Jr <rabroersma@yahoo.com>)
Re: get a pkey/id back from/after an insert  (Sean Davis <sdavis2@mail.nih.gov>)
Список pgsql-novice
On Mon, Jun 19, 2006 at 19:10:01 -0700,
  Richard Broersma Jr <rabroersma@yahoo.com> wrote:
> Well for testing purposes it should be fine to explicitly call out currentval.  But be careful if
> you are going to be using multiply connections at onces.  I am not sure that currentval will give
> you what you want if another connection calls nextval first before you insert a record to your
> child table.

It will do what is expected. currval returns the last value allocated in
your session. It wouldn't be much use if other connections could change
the value out from under you.

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

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: get a pkey/id back from/after an insert
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Re: get a pkey/id back from/after an insert