Why CockroachDB and PostgreSQL Are Compatible Written by on Dec 1, 2020 CockroachDB is built to be largely compatible with PostgreSQL, meaning that software written to use PostgreSQL can often be used with CockroachDB without changes. Why is CockroachDB compatible with PostgreSQL? Perhaps surprisingly, at the time of writing (early May 2018), the answer to this question had not been documented publicly on the CockroachDB web site, nor in the CockroachDB docs, nor in CockroachDB-related articles in third party sources. I was lucky to sit next to Cockroach Labs Chief Architect and Co-Founder Ben Darnell when Lakshmi Kannan, now the general manager of CockroachCloud, asked us the very same question: Why was CockroachDB designed to be compatible with PostgreSQL? What follows is an extended rewording of the resulting discussion.