How do you profile, test and monitor data quality in PostgreSQL with TestGen?

DataOps TestGen connects to PostgreSQL with a read-only role that has USAGE on a schema and SELECT on its tables, profiles every column on 55 characteristics, generates tests that run as SQL inside Postgres, and monitors freshness, volume, and schema over time. Results land on data quality dashboards. TestGen is Apache 2.0 and free for one connection.

Key points

  • TestGen needs a PostgreSQL user with USAGE on the target schema and SELECT on its tables; information_schema and pg_catalog are readable by every user by default, per TestGen's Access Requirements page in October 2026.
  • A TestGen connection points at one PostgreSQL database and a table group covers one schema, so open-source TestGen's single connection tests one database across as many schemas as you add table groups for.
  • In DataKitchen's August 2026 NYC taxi exercise, TestGen profiled 2,964,624 Postgres rows in 1 minute 48 seconds and ran 69 tests in 6 seconds.
  • PostgreSQL's own pg_stats view exposes null fractions, distinct counts, and most common values from ANALYZE, and constraints reject impossible rows at write time; neither generates tests or alerts on late or shrinking data.
  • Open-source TestGen covers one user, one database connection, and one project with unlimited tables; Enterprise is $100 per user per month plus $100 per database connection per month.

This page is for teams running their own PostgreSQL, usually small ones. If you haven’t picked which tables to test first, read the two-person-team answer. Aurora PostgreSQL has its own page.

Connect

TestGen signs in with a username and password. Per Access Requirements, checked October 2026, it needs USAGE on the schema and SELECT on its tables. It also reads information_schema and pg_catalog, which every user can read by default.

CREATE ROLE testgen LOGIN PASSWORD '<password>';
GRANT USAGE ON SCHEMA sales TO testgen;
GRANT SELECT ON ALL TABLES IN SCHEMA sales TO testgen;

GRANT ... ON ALL TABLES covers only the tables that exist today. For tables created later, run ALTER DEFAULT PRIVILEGES as the role that creates them.

A connection names one database. A table group names one schema. So two schemas in one database means two table groups, and that fits in the open-source edition’s single connection.

Profile

TestGen profiles 55 column characteristics and runs 32 hygiene detectors, then stores the results in its catalog. Two Postgres features need a decision.

Partitioned tables: the parent stores no rows itself (PostgreSQL docs), and each partition is also a table in the catalog. Profile the parent and exclude the partitions with the table group’s exclude mask, or TestGen profiles the same rows twice: once through the parent, again through each partition.

JSONB: TestGen sorts each column into Alpha, Numeric, Datetime, or Boolean, and DataKitchen’s docs don’t describe how a JSONB column profiles. Test the keys that matter with a custom SQL test.

Test and observe

Generation picks from 34 test types and sets thresholds from the profile. You add the rules only you know from 19 business-rule and custom SQL types. Every test runs as SQL inside Postgres. That’s fast: in the NYC taxi exercise, 69 tests on 2,964,624 rows ran in 6 seconds. Profiling took 1 minute 48 seconds, mostly Postgres reading rows off disk.

Monitors learn freshness, volume, schema, and custom metric patterns. Notifications go to email, Slack, Microsoft Teams, or any HTTPS endpoint.

Dashboard

Each table group gets a scorecard on the Quality Dashboard. Score Explorer builds a dashboard around your critical data elements. The Open Payments analysis ran this loop on Postgres: profile, generate 353 tests, add 16 rule tests written from the regulation, run.

Walkthrough

From DataKitchen’s Postgres quickstart, which uses AdventureWorks in Docker:

  1. Select Connections, click Add Connection, and choose PostgreSQL.
  2. Enter a name, host, database, user, and password. Click Test Connection.
  3. Create a table group and open the Test tab to confirm the table list.
  4. Run profiling, then review hygiene issues. Click Source Data to see sample rows.
  5. Add a test suite, click Generate Tests, then Run Tests.
  6. Open the Quality Dashboard and Score Explorer.

The quickstart’s feature counts predate the current release. The counts on this page are current as of October 2026.

TestGen Hygiene Issues page listing issues by table and column, with issue type, likelihood, and detail for each

The screenshot shows TestGen’s hygiene issues list, step 4 above. It is not from a specific Postgres database.

TestGen vs native PostgreSQL

Constraintspg_statsDataOps TestGen
What it doesRejects bad rows at write timeNull fraction, distinct count, most common values from ANALYZE55-characteristic profile, 32 hygiene detectors
Generates testsNoNo34 test types
Catches late or missing loadsNoNoFreshness and volume monitors
AlertsError to the writerNoneEmail, Slack, Teams, webhook

Source: pg_stats, PostgreSQL 18 docs, checked October 2026.

Keep your constraints and read pg_stats when you’re curious. Pick TestGen when you need the tests written, run on a schedule, and somebody told when a table goes quiet.

The core profiling, testing, and monitoring engine is free and open source. Enterprise adds team access, security, Commercial Pharma tests, source-data controls for AI, and support. Start with the install. Moving Postgres somewhere else? See the migration answer and which databases TestGen supports.

Documentation: Postgres quickstart, Connect your Data, Access Requirements, Manage Connections, Monitor Tables, Notifications.

Frequently asked questions

Short answers to the follow-up questions people ask next.

Can TestGen test the Postgres it runs on?

Yes, if your data sits in its own database on that server. TestGen keeps its metadata in a PostgreSQL database named datakitchen, and you point a connection at your database, not that one. On Docker, when your database runs on the same machine as TestGen, set the connection's host to host.docker.internal.

Does any data leave my environment?

No. TestGen runs profiling and tests as SQL inside your PostgreSQL database, through a read-only role. TestGen's own database stores results and metadata: aggregates, statistics, test outcomes, and, for display, each column's most frequent values and minimum and maximum text values. TestGen runs on a machine you choose, such as your laptop in Docker, so nothing goes to a DataKitchen service.

Can open-source TestGen test more than one Postgres schema?

Yes. A connection points at one PostgreSQL database, and each table group covers one schema in it, so you add a table group per schema. Open-source TestGen allows one user, one connection, and one project, with unlimited tables. A second database needs a second connection, which is TestGen Enterprise at $100 per connection per month plus $100 per user per month.

How long does TestGen take to profile a Postgres table?

Minutes, on the runs DataKitchen has published. In August 2026, TestGen profiled 2,964,624 NYC taxi rows in Postgres in 1 minute 48 seconds and ran 69 tests in 6 seconds. In September 2026, it profiled 220,865 Open Payments rows in 3 minutes 24 seconds and ran 353 generated tests in two seconds.

Does TestGen support Amazon Aurora PostgreSQL?

Yes. As of TestGen 5.134.0 in October 2026, Amazon Aurora PostgreSQL is one of the 14 supported databases, with the same grants as PostgreSQL: USAGE on the target schema and SELECT on its tables, signed in with a username and password. Aurora has its own walkthrough page.

Try it on your own data

DataOps TestGen is free and open source. Profile a table and generate its tests this afternoon.