Re: lastval()

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: lastval()
Дата
Msg-id 42A3D79E.4030001@samurai.com
обсуждение исходный текст
Ответ на Re: lastval()  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: lastval()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Tom Lane wrote:
> This definition is OK with me ... so long as it still includes the
> phrase "an error occurs if no nextval or setval has occurred in the
> current session".  However it seemed that a number of people asking
> for the feature wanted some-random-default to be returned instead.

Right -- I think it definitely needs to return an error in that
situation. Per my earlier mail, the other debatable behavior is whether
lastval() should be defined if the sequence it would be returning the
currval() for has been subsequently dropped. I'm inclined to not return
an error here to simplify the implementation, but I'm open to objections.

> Another question is why should setval affect the result?  I don't
> see the use-case for that offhand.

I'm not militant about it, but having setval() affect the result means
lastval() is more consistent with currval().

-Neil

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: lastval()
Следующее
От: Tom Lane
Дата:
Сообщение: Re: lastval()