PostgreSQL Random Data Generator

Generate realistic random test rows for PostgreSQL with SQL export, API integration, or direct table population.

Developer API

Use SQL generation in scripts and CI pipelines.

API Documentation
Disclaimer

For test data only. Never run against production data unless you fully understand write impact.

Generate PostgreSQL SQL

Need more than 1,000,000 records? Reach out to kedar@nitty-witty.com.
Generation timing: 0.00s | 0 rows/s
SQL Preview

                                
                            

Connect to PostgreSQL and Populate

Warning: This performs INSERT operations on the target PostgreSQL table.
Progress
Ready...
Elapsed: 0.00s | Throughput: 0 rows/s | ETA: --

DIY / CLI Instructions

1. Start local server
php -S 127.0.0.1:8080
2. Test SQL generation API
curl -X POST http://127.0.0.1:8080/api/v1/generate/sql -H "Content-Type: application/json" -d '{"table_definition":"CREATE TABLE users(id BIGINT,email TEXT)","rows":10}' --output generated.sql
3. Execute SQL file on PostgreSQL
psql -h 127.0.0.1 -U postgres -d mydb -f generated.sql

pgbench Script & Command Builder

Generate a ready-to-run pgbench script and command from a PostgreSQL CREATE TABLE definition.

Suggested pgbench Command
Generated Script (generated_pgbench.sql)

                                

                                
Notes: UUID generation uses gen_random_uuid() (requires pgcrypto extension). Run CREATE EXTENSION IF NOT EXISTS pgcrypto; once in your database.

Why This Tool Exists

PostgreSQL test data generation often requires one-off scripts and repetitive manual effort. This tool provides a predictable path for local development, QA, and demos.

How It Works

Parse your PostgreSQL `CREATE TABLE` statement and emit randomized INSERT SQL.

Connect via PDO PostgreSQL driver, introspect schema metadata, and insert in batches.

Use `curl` and `psql` commands directly if you prefer terminal-driven workflows.

Convert table definitions into a pgbench script and command for concurrent load-oriented data generation.

Host Locally

See full setup instructions for PHP + PostgreSQL local hosting.

Open Local Hosting Steps