Skip to content

Instantly share code, notes, and snippets.

View hiimivantang's full-sized avatar

hiimivantang

View GitHub Profile
@dmagda
dmagda / mock_data_generation_postgres.md
Last active May 24, 2023 05:29
Mock data generation with built-in database capabilities

Mock data generation with built-in database capabilities

Relational databases such as PostgreSQL can do much more than store and return your application records. Those databases usually come with comprehensive compute capabitilies.

In this short note, let's review the generate_series function of PostgreSQL, then can generate mock data of various complexity.

  1. Create a sample table for time-series data:
    create table sensor (
      id int,