Re: Last ID Problem

Поиск
Список
Период
Сортировка
От Mitch Pirtle
Тема Re: Last ID Problem
Дата
Msg-id 330532b605013117551658dd1d@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Last ID Problem  (Michael Fuhr <mike@fuhr.org>)
Ответы Re: Last ID Problem
Список pgsql-novice
On Mon, 31 Jan 2005 18:38:55 -0700, Michael Fuhr <mike@fuhr.org> wrote:
>
> Contrary to what another message in this thread says, it is indeed
> common practice to do the insert first and call currval() afterwards
> to find out what value you got from the sequence.  And no, this
> doesn't introduce a race condition -- currval() returns the last
> value obtained from the sequence in the current session.

Tell that to the maintainers of PEAR's DB, which is installed by
default with all recent versions of PHP (that would be all of them). I
felt the exact same way as you did, and spent an afternoon
rediscovering the joys of sequence values until one of the maintainers
pointed out that behavior. I even tried to convince them that this was
a bug ('inappropriate behavior' was the term IIRC)...

'Common', unfortunately, is relative; and in this matter might only
apply to ADOdb ;-)

-- Mitch, getting his PHP database classes all mixed up *gasp*

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

Предыдущее
От: "Mike G."
Дата:
Сообщение: Re: pgAdminIII and User Grants
Следующее
От: Alexander Borkowski
Дата:
Сообщение: Re: pgAdminIII and User Grants