Nov. 10, 2023, 4:51 p.m. | Dylan Paulus

DEV Community dev.to

Original Post: https://www.dylanpaulus.com/posts/easily-generate-mock-data-with-postgresql


When writing articles about PostgreSQL there are times I need to generate large swaths of data to test and demonstrate a topic (for example, these Timescale articles here and here).

It can be a pain to manually insert data or create a CSV and import it into PostgreSQL--which I always have to StackOverflow.

Lately, I ran into a much simpler solution to generating data: the generate_series function.

It's perfectly suited for integers and timestamp data …

articles csv data database datascience example generate import pain postgres postgresql sql stackoverflow test timescale writing

Software Engineer for AI Training Data (School Specific)

@ G2i Inc | Remote

Software Engineer for AI Training Data (Python)

@ G2i Inc | Remote

Software Engineer for AI Training Data (Tier 2)

@ G2i Inc | Remote

Data Engineer

@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania

Artificial Intelligence – Bioinformatic Expert

@ University of Texas Medical Branch | Galveston, TX

Lead Developer (AI)

@ Cere Network | San Francisco, US