currval question
От | Andy Kriger |
---|---|
Тема | currval question |
Дата | |
Msg-id | OJEFIHHAALOBKKJEOMBDAEAGCAAA.akriger@greaterthanone.com обсуждение исходный текст |
Ответы |
Re: currval question
Re: currval question Re: currval question Re: currval question |
Список | pgsql-general |
I am trying to get the last value updated by an column auto-incrementing with nextval(). In MySQL, you'd use LAST_INSERT_ID() - in Postgre, currval() appears to do the trick. Is this maintained on a per-connection basis? For example, user A inserts and the nextval() updates to 5, user B does 2 inserts, updating nextval() to 7. When user A calls currval() they should get 5 if the updates are per-cnx. What does psql do under the hood here? thx a
В списке pgsql-general по дате отправления: