Re: BUG #4684: lastval in function
От | Andreas |
---|---|
Тема | Re: BUG #4684: lastval in function |
Дата | |
Msg-id | gogrdq$1uvg$1@news.hub.org обсуждение исходный текст |
Ответ на | Re: BUG #4684: lastval in function (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
Список | pgsql-bugs |
Heikki Linnakangas schrieb: > andreas wrote: >> if nextval is used inside a function in a insertstatement, you get always >> the value from inside the last function. but i expected, that lastval() >> deliver the value from the insertstatement. i think, this should >> clearify in >> the documentation, or better fixed that the nextval from an >> insertstatement >> is called after the functioncalls. > > Well, others might expect the opposite, like existing applications. Want > to suggest wording for the documentation? Yes, existing applications might be involved. But i think, this is a very rare situation. But if someone use an insertstatement with a functioncall, but the function do NOT use nextval, and he use lastval to estimate the last inserted value he has no problems. But if then someone change the function so the function use nextval then the application crashes. So i think it is much more better to change the behavior, because this is what i expect. And i think, this is what others expect too. Andreas
В списке pgsql-bugs по дате отправления: