Press "Enter" to skip to content

An Edge Case with Row Locks and Joins in PostgreSQL

Haki Benita digs into a problem:

Here’s a database riddle: you have two tables with data connected by a foreign key. The foreign key field is set as not null and the constraint is valid and enforced. You execute a query that joins these two tables and you get no results! How is that possible? We thought it wasn’t possible, but a recent incident revealed an edge case we never thought about.

If you answered “READ COMMITTED isolation level is weird,” congratulations: you win a prize.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.