Re: Create on insert a unique random number

Поиск
Список
Период
Сортировка
От paul rivers
Тема Re: Create on insert a unique random number
Дата
Msg-id 47DFFCE9.8000307@gmail.com
обсуждение исходный текст
Ответ на Re: Create on insert a unique random number  ("Campbell, Lance" <lance@uiuc.edu>)
Список pgsql-sql
Campbell, Lance wrote:
> I created the following table:
>
> create table xyz (
> n serial, 
> abc character varying, 
> constraint n_pkey primary key (n));
>
> Each time I do an insert:
>
> insert into xyz(abc) values('adf6');
>
> The field n is not random but is sequential.  Is there something I
> should do to make the serial number random?
>
> Thanks,
>
>
>   

Why do you want a random number? Would a guid work?

Paul



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

Предыдущее
От: "Campbell, Lance"
Дата:
Сообщение: Re: Create on insert a unique random number
Следующее
От: "D'Arcy J.M. Cain"
Дата:
Сообщение: Re: Create on insert a unique random number