| От | Bruno Wolff III |
|---|---|
| Тема | Re: function for creating random id |
| Дата | |
| Msg-id | 20020415184949.GA10684@wolff.to обсуждение исходный текст |
| Ответ на | function for creating random id (Moritz Sinn <moritz@freesources.org>) |
| Ответы |
Re: function for creating random id
|
| Список | pgsql-general |
On Mon, Apr 15, 2002 at 05:51:53PM +0200, Moritz Sinn <moritz@freesources.org> wrote: > hi, > > i've got a table called "user". every user should have a userid, which > is the primary key. this userid is a random number with up to 6 digits. > > but now the problem is that the id which is returned by getuid() could > already be in use. > so what is the best method to realize that? Do the IDs really need to be random? Is the order that users were created in really secret information? If they don't, you can use a sequence to allocate IDs.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера