| От | Scott Marlowe |
|---|---|
| Тема | Re: how to prevent generating same clipids |
| Дата | |
| Msg-id | 1144704108.32269.73.camel@state.g2switchworks.com обсуждение исходный текст |
| Ответ на | how to prevent generating same clipids (v.suryaprabha@gmail.com) |
| Ответы |
Re: how to prevent generating same clipids
|
| Список | pgsql-general |
On Mon, 2006-04-10 at 07:02, v.suryaprabha@gmail.com wrote: > Hi All, > > I am having the clipid field in my table.In my application i am taking > Max(clipid) and inserting it into the table by incrementing that max > value. so there is a problem when 2 users click sumbit button at a > time. we r getiing same value . so hoe to solve the problem You need to use a sequence. You can either have the database assign the value automatically by declaring the field type to be serial (instead of int) or bigserial (instead of int8) or you can assign the value yourself using the nextval / currval functions.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера