Re: Random Numbers/Letters
От | Bruno Wolff III |
---|---|
Тема | Re: Random Numbers/Letters |
Дата | |
Msg-id | 20020318152143.GA26618@wolff.to обсуждение исходный текст |
Ответ на | Random Numbers/Letters ("Hillensbeck, Preston" <PHillensbeck@sfbcic.com>) |
Список | pgsql-general |
On Thu, Mar 14, 2002 at 08:57:49AM -0600, "Hillensbeck, Preston" <PHillensbeck@sfbcic.com> wrote: > Hello, > > This may have been discussed before(I have looked and could not find > much on this), but I need to find a way to generate random numbers and > letters together to insert into a field when a new entry is created. Just > to give you a little insight, I will be accepting images from people and I > want to generate a random line of numbers or letters so that I can put a > name on a picture, and when someone pulls up a profile of the user, it will > pull the picture with the random name out of the directory. I haven't been > able to find much on random number/letter generators within PostgreSQL so I > wanted to post here. If anyone has an easy way for this to be done, please > let me know. Thanks :) I think you would be better off using a sequence instead. It seems what you mostly want is a unique name. If you use random names, there is a chance of a collision and this will make coding more complicated.
В списке pgsql-general по дате отправления: