Re: Last ID

Поиск
Список
Период
Сортировка
От Brett W. McCoy
Тема Re: Last ID
Дата
Msg-id Pine.LNX.4.30.0103021351090.22539-100000@chapelperilous.net
обсуждение исходный текст
Ответ на Re: Last ID  (Catalin CIOCOIU <catalin.ciocoiu@inpg.fr>)
Список pgsql-novice
On Fri, 2 Mar 2001, Catalin CIOCOIU wrote:

>     This method don't encourage using serial data type. Practically, in the
> joined table I can't use "serial" data type for primary key. I nead to
> use sequences by hand.
>     The last solution work fine, but I need a variable for store the
> nextval('<seq name>').
>
> There is not a other solution ?

It turns out I was wrong -- using currval is session-based, as Tom Lane
has pointed out.  However, still see the notes in the docs on caching
more than one values for each backend.  This may or not be pertinent.

-- Brett
                                     http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
While money doesn't buy love, it puts you in a great bargaining position.


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

Предыдущее
От: "Chuck Kimber"
Дата:
Сообщение: RE: Last ID
Следующее
От: "Donald Braman"
Дата:
Сообщение: www.postgresql.org