Hi, I'm not really sure why this feature would be useful, but I saw something similar in OpenBravoPOS, the id on their tables are characters instead of integers and they use UUID values as the IDs.
I don't really like that solution, specially for the fact that the key size is bigger and thus, the database size would grow a lot with many rows, but maybe it would help you in this use case... Cheers. Cédric Krier escribió: > Hi, > > I would like to add a new type of sequence in Tryton that will generate random > but unique number. > A simple solution will be to generate random number and compare it with > already generated number (stored in a table). But there is the birthday > paradox [1] that reduces the speed of this method. > > An other way will be to store in a table every possible value (if the length > of the number is fixed) and pick/remove one randomly. But here the generation > of all values can be slow. > > Is there anybody that knows a better way? > > > [1] http://en.wikipedia.org/wiki/Birthday_paradox > > -- Carlos Perelló Marín [P+] SERVICIOS PROFESIONALES http://www.pemas.es mailto:[email protected] || mailto:[email protected] Este mensaje y los ficheros anexos son confidenciales. Los mismos contienen información reservada de la empresa que no puede ser difundida. Si usted ha recibido este correo por error, tenga la amabilidad de eliminarlo de su sistema y avisar al remitente mediante reenvío a su dirección electrónica; no deberá copiar el mensaje ni divulgar su contenido a ninguna persona. Su dirección de correo electrónico junto a sus datos personales forman parte de un fichero titularidad de PEMAS Servicios Profesionales, S.L. cuya finalidad es la de mantener el contacto con Ud. De acuerdo con la Ley Orgánica 15/1999, usted puede ejercitar sus derechos de acceso, rectificación, cancelación y, en su caso, oposición enviando una solicitud por escrito, acompañada de una fotocopia de su DNI dirigida a PEMAS Servicios Profesionales, S.L. C/ Santos Justo y Pastor, 72 - 5, C.P. 46022 de Valencia (España). -- [email protected] mailing list
