Re: Filling Missing Primary Key Values

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Filling Missing Primary Key Values
Дата
Msg-id alpine.LNX.2.00.1108111233020.14240@salmo.appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Filling Missing Primary Key Values  (Chris Travers <chris.travers@gmail.com>)
Ответы Re: Filling Missing Primary Key Values  (Chris Travers <chris.travers@gmail.com>)
Re: Filling Missing Primary Key Values  (Steve Atkins <steve@blighty.com>)
Список pgsql-general
On Thu, 11 Aug 2011, Chris Travers wrote:

> The simplest seems to me to be a sequence and use nextval() to populate
> the null values. The major advantage would be that the sequence could stay
> around in case you need it again. So for example:
>
> create sequence my_varchar_values;

> UPDATE my_table set my_varchar =
> nextval('my_varchar_values')::varchar(12) where my_varchar IS NULL;

Chris,

   I was wondering if this was the best approach since I have new data to add
to the table. Don't need a starting value, eh?

Many thanks,

Rich

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

Предыдущее
От: Chris Travers
Дата:
Сообщение: Re: Filling Missing Primary Key Values
Следующее
От: Chris Travers
Дата:
Сообщение: Re: Filling Missing Primary Key Values