
SQLsmith is a random SQL query generator. Its paragon is Csmith, which proved valuable for quality assurance in C compilers.
It currently supports generating queries for PostgreSQL 9.5+ and sqlite3.
Besides PostgreSQL developers, users developing extensions of PostgreSQL might also be interested in exposing their code to SQLsmith's random workload.
During its prototyping stage, it already found about thirty bugs in PostgreSQL alphas, betas and releases, including security vulnerabilities in released versions.