Skip to content

Intro to pg_yregress

pg_yregress is a regression testing tool for Postgres.

This tool takes original inspiration from pg_regress but addresses some of the issues it has, such as:

  • Unstructured tests 1
  • Single Postgres instance operation 2
  • Lack of query/test re-use
  • Binary encoding testing
  • Per-query timeouts

pg_yregress core idea is to express test cases and setups using YAML files for structuring and comparison. YAML sometimes carries some bad reputation due to being overused in places where it doesn't fit well, as well as somewhat surprising implicit tag resolution scheme results.

However, the authors believe that YAML is actually a pretty good fit for the use of grouping queries and expected results. Some features, like anchors and references, are very helpful in succinct representation of tests.

pg_yregress is in its early days

Not all intended functionality has been implemented, and the one that has been, may suffer from critical bugs. The user experience is rather crude at the moment.

None of this is impossible to overcome. Please consider contributing.


  1. pg_regress relies on plain text psql session capture and its comparison with the "baseline" 

  2. This prevents us from testing more complicated scenarios such as replication or database links.