PostgreSQL · pg_dump · test data

PostgreSQL test data generator with foreign keys that resolve.

Read your pg_dump schema or connect live on port 5432 and get a populated database where declared foreign keys resolve. SERIAL and IDENTITY keys, JSONB, text[] arrays, uuid, citext, numeric, timestamptz and ENUM types from CREATE TYPE are handled, tested against a real 20-app project with 226 tables.

Free tier · no card · EU-hosted · zero trackers

From pg_dump schema to populated Postgres

Paste a pg_dump --schema-only file or your CREATE TABLE DDL in the web app, push from the VS Code or PyCharm plugin, or use the CLI. The parser reads SERIAL and GENERATED ALWAYS AS IDENTITY primary keys, REFERENCES clauses across the public and other schemas, ENUM types declared with CREATE TYPE, and DEFERRABLE constraints, so the generated rows satisfy them.

DDL in, SQL out
CREATE TYPE order_status AS ENUM ('pending','paid','shipped');

CREATE TABLE app_user (
    id          BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    email       CITEXT UNIQUE NOT NULL,
    tags        TEXT[] DEFAULT '{}',
    created_at  TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE TABLE "order" (
    id          SERIAL PRIMARY KEY,
    user_id     INTEGER NOT NULL REFERENCES app_user(id),
    status      order_status NOT NULL,
    total       NUMERIC(10,2) NOT NULL,
    metadata    JSONB NOT NULL DEFAULT '{}'
);

-- → INSERT INTO app_user ... 200 rows, citext emails unique
-- → INSERT INTO "order" ... user_id resolves (declared FK),
--    status ∈ enum, total numeric, metadata valid JSONB,
--    2-19 orders per user, long-tail distributed

What you get

FK-consistent

Declared foreign keys resolve

Children reference parents that exist, including self-references and one-to-one relations. Inserts come out in topological FK order, so the SQL loads into a constrained Postgres schema with \copy or psql as-is.

pg-types

Real Postgres types

SERIAL and BIGSERIAL keys, JSONB objects, text[] arrays, uuid (gen_random_uuid()-style values), citext, numeric, timestamptz and ENUM values from CREATE TYPE, plus generated columns left to the database.

realistic

Production-like distributions

Not every user has exactly 5 orders: long-tail and normal distributions create the skew where pagination and N+1 bugs actually show up.

current

Time-aware data

timestamptz values generate relative to today, so "last 30 days" dashboards stay populated instead of going empty as fixtures age.

reproducible

Deterministic per seed

Same seed, same data, reproducible CI runs. Export the generation config as JSON and commit it next to your migrations.

editor

VS Code & PyCharm plugins

Push your schema to SeedBase in one click, it lands parsed and ready to generate against your Postgres tables.

How it loads into Postgres

Read the schema

Paste pg_dump --schema-only output, raw CREATE TABLE DDL, or connect live on host and port 5432. SERIAL, IDENTITY, REFERENCES, CREATE TYPE enums and DEFERRABLE constraints are parsed.

Generate FK-consistent rows

Rows are produced in topological order from the declared foreign keys: parents before children, self-FKs row by row, uuid and JSONB filled with plausible values.

Export or push

Download a SQL dump for psql, CSV for COPY FROM / \copy, or JSON, or push straight into a live Postgres connection with constraints enabled.

Tested against a real project with 20 apps and 226 tables: declared foreign keys resolve, ENUM columns stay inside their CREATE TYPE values, and the SQL imports under enabled constraints without manual reordering. SeedBase does not invent constraints your schema never declared.

FAQ

Does it handle SERIAL primary keys and JSONB columns?

Yes. SERIAL, BIGSERIAL and GENERATED ALWAYS AS IDENTITY columns are treated as auto-incrementing keys, so foreign keys have stable integers to point at. JSONB columns get plausible structured objects, text[] arrays get array literals, and uuid columns can use gen_random_uuid() style values.

Can it read my pg_dump?

Yes. Paste a pg_dump --schema-only file or any CREATE TABLE DDL, or connect live on port 5432. The parser reads SERIAL and IDENTITY keys, REFERENCES clauses across schemas, ENUM types from CREATE TYPE, and DEFERRABLE constraints, then generates rows that satisfy them.

In what order are the INSERT statements emitted?

Tables are sorted in topological order from the declared foreign keys, so parents are inserted before children and a constrained schema loads with \copy or psql without reordering. Self-referencing foreign keys load row by row so each reference points at an earlier row.

How do I load the generated data into Postgres?

Download a SQL dump and run it with psql, use COPY FROM or \copy for the CSV export, or push directly into a live Postgres connection (host, port 5432, database). Inserts come out in FK order, so timestamptz, numeric and JSONB values land in a schema with constraints enabled.

Two minutes to a fully populated Postgres database

Sign up, read your pg_dump or connect live, generate. No sales call, no credit card, the free tier is enough for a real first impression.

  • FK-consistent
  • JSONB / arrays / uuid
  • SQL / CSV / JSON
  • EU-hosted
Start free

Other stacks: SQL · Django · Prisma  ·  Compare: vs Mockaroo · vs Faker  ·  Anonymize prod data