Question about uid

moofang - July 21, 2008 - 06:25

Hi,

I am intending log user actions in a module I'm developing, and am considering logging the user's uid as an identifier for the user in question. However, I am concerned about the possibility of the following scenario : if user A has uid 1, and at some point user A was deleted, is it possible for another user say B to have a uid 1 later on (and thus result in ambiguity)?

Thanks in advance.

(IIRC) Nope, unless you

lyricnz - July 21, 2008 - 06:57

(IIRC) Nope, unless you fiddle with the DB, there's an incrementing number in some counter table.

UIDs

beautifulmind - July 21, 2008 - 07:04

User ids can't be reassign. Once a user has been deleted, the user id he/she possessed is vanished for ever, unless as you write your own code. Letting Drupal do the dirty work is more secure, however.

Beautifulmind
Know more

user id's are issued from

mb450 - July 21, 2008 - 12:46

user id's are issued from the users table
the uid column is an auto_increment column.
The only way it would be reused is if you reset the auto_increment value

So your users should never be issued an historical users uid.

That is good to hear. Thanks

moofang - July 24, 2008 - 18:13

That is good to hear. Thanks alot guys :)

 
 

Drupal is a registered trademark of Dries Buytaert.