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

Data Architect

@ University of Texas at Austin | Austin, TX

Data ETL Engineer

@ University of Texas at Austin | Austin, TX

Lead GNSS Data Scientist

@ Lurra Systems | Melbourne

Senior Machine Learning Engineer (MLOps)

@ Promaton | Remote, Europe

RL Analytics - Content, Data Science Manager

@ Meta | Burlingame, CA

Research Engineer

@ BASF | Houston, TX, US, 77079