Re: BUG #4684: lastval in function

From: Andreas <postgresql(at)elbrief(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4684: lastval in function
Date: 2009-03-02 14:45:14
Message-ID: gogrdq$1uvg$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Chris Browne 2009-03-02 16:49:03 Re: BUG #4684: lastval in function
Previous Message Jonas R. Pacheco 2009-03-02 13:14:43 BUG #4686: There is not enough memory to complete this operation