| От | Edmar Wiggers |
|---|---|
| Тема | RE: reinitialise serial counter |
| Дата | |
| Msg-id | NEBBIAKDCDHFGJMLHCKIKEAACBAA.edmar@brasmap.com обсуждение |
| Ответ на | reinitialise serial counter (Indraneel Majumdar <indraneel@www.cdfd.org.in>) |
| Список | pgsql-sql |
> after inserting values and doing delete from test if I try to insert > values again, the id starts from where it left off previously. How can I > get the serial counter to restart from 1 ? is it anything to do with > setval(). How to use the setval? The serial value is implemented using a sequence object (see the docs). Once a sequence returns a number it will never return it again (that's what sequences are for!). A serial field is not a good approach if you always want to start numbering at 1. Yours sincerely, Edmar Wiggers BRASMAP Information Systems +55 48 9960 2752
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера