Let's say I'm creating a table foo with a column bar that should be a very large random integer.
CREATE TABLE foo (
bar bigint DEFAULT round(((9223372036854775807::bigint)::double precision * random())) NOT NULL,
baz text
);
Is this the best way to do this? Can anyone speak to the quality of PostgreSQL's random()
function? Is the multiplication here masking the entropy?
Note that I do have good hardware entropy feeding into /dev/random
.