Re: Changing ids conflicting with serial values?

Поиск
Список
Период
Сортировка
От MaXX
Тема Re: Changing ids conflicting with serial values?
Дата
Msg-id dkf001$1qdo$1@talisker.lacave.net
обсуждение исходный текст
Ответ на Changing ids conflicting with serial values?  (Steven Brown <swbrown@ucsd.edu>)
Список pgsql-general
Steven Brown wrote:

> When I change an id (primary key serial) in a table, the next value
> returned by the sequence for the id can conflict with that id (e.g.,
> change the id to be id + 1).  [...]
If you're doing this to have a custom ordering of your data, consider adding
another int column without PK so you can change whatever you want, and keep
an unique way to access (an identify) your data even if it has been
moved...

In my case I wanted to sort my row freely, my first tough was to use the
already existing id (serial PK) column and change it. That worked fine
until I tryied to move a row without freeing the destination first... I
added a new column and changed my "order by" to match its name.

If this can help,
--
MaXX


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

Предыдущее
От: Douglas McNaught
Дата:
Сообщение: Re: Postgresql connection on suse 10
Следующее
От: Joe Conway
Дата:
Сообщение: Re: Array Values and References