Re: interesting! a sequence clashes with data already in that table

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: interesting! a sequence clashes with data already in that table
Дата
Msg-id 20041008132714.GA9830@wolff.to
обсуждение исходный текст
Ответ на interesting! a sequence clashes with data already in that table  (Miles Keaton <mileskeaton@gmail.com>)
Список pgsql-general
On Fri, Oct 08, 2004 at 03:00:07 -0700,
  Miles Keaton <mileskeaton@gmail.com> wrote:
> I thought Postgres would be smart enough to make the clients_id_seq
> skip existing numbers, but I guess not!

It wouldn't be very efficient to do that.

> Do I, instead, have to be smart enough to set the sequence over the
> highest existing id# from my imported data, so that it can blindly
> increment without clashing?

That is normally what you want to do.

> If so, setval() would be best for that, right?

Yes.

В списке pgsql-general по дате отправления:

Предыдущее
От: David Garamond
Дата:
Сообщение: Re: text + text
Следующее
От: David Garamond
Дата:
Сообщение: Re: when to use NULL and when to NOT NULL DEFAULT ''