| От | Gregory Wood |
|---|---|
| Тема | Re: [Q] Sequences, last_value and inserts |
| Дата | |
| Msg-id | 01f101c281e7$fbf65ad0$7889ffcc@comstock.com обсуждение исходный текст |
| Ответ на | Re: [Q] Sequences, last_value and inserts ("Marie G. Tuite" <marie.tuite@edisonaffiliates.com>) |
| Список | pgsql-general |
> select last_value from domain_info_tbl_key_seq; > > This returns the same value as currval. In most cases, yes. However: "Also, last_value will reflect the latest value reserved by any backend, whether or not it has yet been returned by nextval." http://www.postgresql.org/idocs/index.php?sql-createsequence.html It is possible that someone else has changed the sequence value before you read it, meaning you will not get the value you just inserted (like you would with currval), but the value of the *other* insert. This is precisely the problem that the original question was posed to avoid. Greg
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера