Repository

viralpraxis/pg_disorder

pg_disorder

PostgreSQL extension to shuffle rows returned by SELECT without explicit order

6stars

Open github.com

viralpraxis/pg_disorder

pg_disorder

PostgreSQL extension that shuffles or reverses unordered SELECT results to help find flaky tests and trigger invalid states.

Visit project

Show me a random project

First shared
Aug 18, 2026
HN activity
12

Show HN@viralpraxisAug 18, 2026

Show HN: Pg_disorder – shuffle or reverse unordered SELECT results

Hey HN! I'm interested in chaos engineering, automatically detecting flaky tests, and, more generally, building tools that can find/trigger invalid states in software systems. My latest experiment is pg_disorder, a PostgreSQL extension that automatically shuffles (or reverses) the results of `SELECT` queries without an `ORDER BY` clause. While the order of rows isn't specified, applications (sometimes) implicitly assume that rows will be returned in insertion order. The project was initially aimed at finding flaky tests, but it also helped uncover bugs in projects like Gitea and Rails (see references in the repo). Some DBMSs have this feature built-in, e.g. SQLite's `reverse_unordered_selects` pragma, but PostgreSQL doesn't. I'd love to hear your thoughts and feedback!

Community

Hacker News discussion

Loading the thread…