2

In SQL in Postgres, how do I create and insert n number of rows of test data with random strings length x?

e.g.,

CREATE TABLE my_table (my_text_column TEXT);
-- now insert n rows of test data into my_table, with random
-- strings of length x for my_text_column
0

1 Answer 1

4

The answer is already available here

create table yourtable as select descr from 
          (SELECT generate_series(1,10) AS id,md5(random()::text) AS descr)s;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.