Re: BUG #4684: lastval in function
| От | Heikki Linnakangas |
|---|---|
| Тема | Re: BUG #4684: lastval in function |
| Дата | |
| Msg-id | 49AB981A.2050009@enterprisedb.com обсуждение исходный текст |
| Ответ на | BUG #4684: lastval in function ("andreas" <postgresql@elbrief.de>) |
| Ответы |
Re: BUG #4684: lastval in function
|
| Список | pgsql-bugs |
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?
To get the id of the row inserted, use INSERT RETURNING. Or currval('bla2').
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
В списке pgsql-bugs по дате отправления: