Re: Generating random values. - Mailing list pgsql-general

From Edmund
Subject Re: Generating random values.
Date
Msg-id m3br3wdyan.fsf@elb_lx.onesystem.ca
Whole thread Raw
In response to Generating random values.  (Fernando Lujan <flujan@gmail.com>)
Responses Re: Generating random values.  (Chris Travers <chris@travelamericas.com>)
Re: Generating random values.  (Mike Nolan <nolan@gw.tssi.com>)
Re: Generating random values.  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
jd@commandprompt.com ("Joshua D. Drake") writes:

> Fernando Lujan wrote:
> > Hi folks,
> > I have a table wich contains my users... I want to insert to each
> > user
> > a random password, so I need a random function. Is there such function
> > in Postgres? I just found the RANDOM which generates values between
> > 0.0 and 1.0.
> > Any help or suggestion will be appreciated. :)
>
> I would do someting like:
>
> select substring(md5(random() || random()), 5, 8);
>
> Sincerely,
>
> Joshua D. Drkae

Great! a simple, dumb program can generate all your passwords in very
quickly.  My 2.4 Ghz Pentium 4 did it in under 10 minutes.  A token set of
16 characters, and a fixed length of 8 charachters just isnt a very big
search space.


pgsql-general by date:

Previous
From: Aliomar Mariano Rego
Date:
Subject: Re: Set autocommit to off
Next
From: Michael Fuhr
Date:
Subject: Re: How to determine table schema in trigger function