postgresql get random data from table
select your_columns from your_table ORDER BY random()
Source: stackoverflow.com
insert random values in rows postgres
CREATE OR REPLACE FUNCTION random_between(low INT ,high INT) RETURNS INT AS $$ BEGIN RETURN floor(random()* (high-low + 1) + low); END; $$ language 'plpgsql' STRICT; Code language: SQL (Structured Query Language) (sql)
Source: www.postgresqltutorial.com
insert random numbers in columns postgress
update foo set bar = floor(random() * 9 + 1); -- from 1 to 10, inclusive
Source: stackoverflow.com