The following will generate the same random number:
SELECT
setseed(0.5),
generate_series(1, 3) as id,
round(random()::decimal, 2) as random_number;
Which outputs something along the lines of :
setseed | id | random_number
---------+----+---------------
| 1 | 0.25
| 2 | 0.25
| 3 | 0.25
I would like something such as
setseed | id | random_number
---------+----+---------------
| 1 | 0.11
| 2 | 0.92
| 3 | 0.38
And to be able to regenerate the above every time, as a result of setting a random seed.
Basically: I don't want the numbers in the random_number
field to be a single random number repeated across all rows, I'd like for each row to be a random number