| От | Richard Huxton |
|---|---|
| Тема | Re: Problem with serial counters |
| Дата | |
| Msg-id | 4D6D5737.3030208@archonet.com обсуждение исходный текст |
| Ответ на | Problem with serial counters ("Jacques Lebrun" <jlebrun@cplus.org>) |
| Список | pgsql-sql |
On 24/02/11 21:09, Jacques Lebrun wrote: > I guess when I do an insert with all the fields (including the RowId), > Postgres does not increment the serial counter. > I cannot remove the RowId field from the Insert of my setup script > because this setup script is also used by customers using MySQL. Apart from Vibhor's suggestion (which is the typical way PG does it) you can also set the auto field to DEFAULT: INSERT INTO mytable (rowid, other) VALUES (DEFAULT,'a'), (DEFAULT,'b'); This should work on either system. -- Richard Huxton Archonet Ltd
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера