Re: serial column

Поиск
Список
Период
Сортировка
От Gevik Babakhani
Тема Re: serial column
Дата
Msg-id 1159139608.726.29.camel@voyager.truesoftware.net
обсуждение исходный текст
Ответ на Re: serial column  (Bob Pawley <rjpawley@shaw.ca>)
Список pgsql-general
On Sun, 2006-09-24 at 15:29 -0700, Bob Pawley wrote:
> "A possible solution for this would be to regenerate the entire column's
> values every time a record gets deleted starting form 1. but then again
> this would be very slow if you have a very large table"
>
> I don't anticipate the table to be more than a few hundred rows - certainly
> fewer than 1,000.
>
> Could you point to some documentation for regenerating a column's values
> other than manual??
>
> Bob
>
 I am afraid there is no built-in way to do that.
perhaps you could create a function that:
step1: creates a sequence (with random name)....
step2: update table set field=netval('random_seq_name');
step3: drop sequence...

--
Regards,
Gevik Babakhani




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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: column names in select don't exists in insert to
Следующее
От: Tom Lane
Дата:
Сообщение: Re: serial column