| От | Bruno Wolff III |
|---|---|
| Тема | Re: How to make sequence skip existing key in table? |
| Дата | |
| Msg-id | 20030218134311.GB11307@wolff.to обсуждение исходный текст |
| Ответ на | How to make sequence skip existing key in table? (Raymond Pau <rpau@yahoo.com>) |
| Список | pgsql-sql |
On Tue, Feb 18, 2003 at 02:01:34 -0800, Raymond Pau <rpau@yahoo.com> wrote: > Hi List, Please don't start new threads by replying to other messages on the list. This screws up threading of messages, which is useful for following specific discussions. > I am using sequence to generate to a list of unique > key id that will be used as the primary key for some > tables. > > My question is when the sequence wraps over to the > minimum value(1), how can I ensure that the next id is > not in the tables? My suggestion is to use the bigserial type. This uses bigint as the underlying type and you are not likely to roll over a 64 bit integer unless you are wasting a lot of serial values for each one you actually use.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера