On Mon, Mar 2, 2009 at 12:21 PM, Tom Lane wrote:
>
> Before considering complicating the definition of lastval, I'd vote
> for removing it entirely. It's a foot-gun and will never be anything
> but.
>
+1
--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo
Chris Browne writes:
> I'm not sure I'd *want* to have a more-sophisticated scoping mechanism
> for this.
We already have an appropriate language-level solution for this: it's
called INSERT RETURNING.
The fact is that lastval was invented to aid in porting brain-dead
mysql applications that were
Andreas writes:
> 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
>>> clearif
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
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
"andreas" writes:
> select lastval() ;
> lastval
> -
>2
> i expected lastval() should be 1, because this is the id from the
> insertstatement.
Well, you can't really rely on that when the statement you're executing
contains two different nextval() calls, as this does. The order
The following bug has been logged online:
Bug reference: 4684
Logged by: andreas
Email address: postgre...@elbrief.de
PostgreSQL version: 8.3.6
Operating system: linux
Description:lastval in function
Details:
create table bla ( id serial primary key , name text not