| От | K Parker |
|---|---|
| Тема | Re: unique sequences |
| Дата | |
| Msg-id | LJEBLKFCBIGCGAAA@shared1-mail.whowhere.com обсуждение |
| Список | pgsql-sql |
> Rather, each time you wish to do an insert, > query the existing data to see what the > maximum value is existing in the database. > Add 1 to that and use this as your new value. > This is guaranteed to not have any holes in > the sequence. True, but alas it _doesn't_ guarantee uniqueness, since there's nothing to prohibit 2 or more back ends getting the samemax() at the same time... Thinking off the top of my head, I'm not sure you can apply FOR UPDATE to an aggregate function, so there's probably no solutionthere, either. Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера