Create table with random data in postgres

This is just for my reference I am creating

create table test_random as select generate_series(1,100),md5(random()::text);

generate_series is function to generate series of numbers.
md5 function accept only text data due to which we are converting the random() function output to text type.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s