Re: HOWTO - Random character generation for primary key

Поиск
Список
Период
Сортировка
От Jean-Michel POURE
Тема Re: HOWTO - Random character generation for primary key
Дата
Msg-id 200205021158.53937.jm.poure@freesurf.fr
обсуждение исходный текст
Ответ на Re: HOWTO - Random character generation for primary key  (postgres@vrane.com)
Список pgsql-general
Le Jeudi 2 Mai 2002 11:30, postgres@vrane.com a écrit :
> Untrue.  I am using email addresses
> as primary keys in a table.  Where
> did you get that information?

Sorry, I did not mean that of course. I posted this small howto in reply to a
mail. It shows how to create a VACHAR PRIMARY KEY with unique random values.

On 10 character lenght, there is approximatively one chance out of 26^10 to
have a similar value. If you add a string timestamp, like "20020501_1153_" in
front of the random value, it is very likely that this value will be UNIQUE
in the word:

Examples:
- 20020501_1153_AHFYRIDKRN
- 20020501_1154_JDIFTPWNEJ

I would like to write a small HOWTOs about :
- Software optimization and performance (not pseudo-hardware / memory /
etc..),
- PLpgSQL and PLpython.

Therefore, I try to send small HOWTOs on the list whenever I can answer
someone. Any help welcome.

Best regards,
Jean-Michel POURE

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

Предыдущее
От: Mark kirkwood
Дата:
Сообщение: Re: On Distributions In 7.2.1
Следующее
От: Jean-Michel POURE
Дата:
Сообщение: Re: HOWTO - Random character generation for primary key