On Mon, Apr 15, 2002 at 05:51:53PM +0200,
Moritz Sinn <moritz(at)freesources(dot)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.