Re: Random strings - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: Random strings
Date
Msg-id Pine.LNX.4.30.0108082119310.692-100000@peter.localdomain
Whole thread Raw
In response to Random strings  ("Joe Conway" <joseph.conway@home.com>)
List pgsql-patches
Joe Conway writes:

> Per the discussion yesterday, here's a patch. There are two versions of
> essentially the same function. They both take an int as the number of
> requested random bytes, and generate a random binary string of the requested
> length from /dev/urandom. The first one (randomstr_hex) converts the binary
> to hex and returns it as text, and the other (randomstr_bytea) does the
> needed escaping of special characters and returns bytea.

Perhaps one of these returning bytea would be enough and you can use
the new encode functions to convert them to a format of choice.  Also, why
aren't you using /dev/random?

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


pgsql-patches by date:

Previous
From: "Joe Conway"
Date:
Subject: Random strings
Next
From: Anders Bengtsson
Date:
Subject: JDBC Statement cleanup patch