Pagila ER diagram — Sakila for PostgreSQL
The PostgreSQL port of the DVD-rental classic: films, actors, inventory, rentals and payments, rendered from the official schema dump.
What you're looking at
Pagila is the PostgreSQL adaptation of the Sakila DVD-rental schema: films are stocked as inventory per store, customers rent them, payments record the money. The core 16 tables here carry the whole story — the film–actor and film–category junctions, the rental→inventory→store chain, and staff tied to stores through addresses. PostgreSQL specifics are on display too: sequences feeding serial keys, ON UPDATE CASCADE rules, and CHECK-style boolean defaults.
This is the 16-table core. The full 71-table schema adds monthly payment partitions (payment_p2022_01 and friends) — paste the full dump into the converter to see them all.
Nothing above is hand-drawn — the diagram is generated from the official schema file, the same SQL you would paste into the SQL to ER diagram converter.
Working in PostgreSQL? The PostgreSQL to ER diagram converter takes any PostgreSQL DDL — pg_dump output, hand-written DDL, or a single CREATE TABLE.
Where the schema comes from
- Source: devrimgunduz/pagila
- License: PostgreSQL Licence
- The schema belongs to its original authors; the diagram above was generated by erd.yizuolab.com.
Questions, answered
What is Pagila?
Pagila is the PostgreSQL adaptation of Sakila, the DVD-rental sample database. It keeps Sakila's domain — films, actors, stores, customers, rentals, payments — while speaking real PostgreSQL: sequences, ON UPDATE CASCADE rules, and partitioned tables.
Why does the diagram show 16 tables when the schema has 71?
The full dump splits payments into dozens of monthly partitions (payment_p2022_01 through payment_p2026_07), which renders as dozens of near-identical child tables. This page prefills the 16-table core so the first frame is readable. Paste the full schema into the converter to see everything — Pro renders up to 500 tables per diagram.
Is this the Sakila schema? Why not use Sakila itself?
It's the same domain, ported to PostgreSQL. Sakila's original is MySQL and licensed GPL, which isn't redistributable here; Pagila carries the permissive PostgreSQL Licence, so it can be shown in full.
What does ON UPDATE CASCADE mean on these lines?
Pagila's reference tables cascade updates as well as deletes — change a country's key and every city row follows. The relationship labels in the diagram carry the on-delete rule; a Mermaid export preserves them as text.
Other real schemas
- Chinook ER diagram — SQLite, 11 tables
- Northwind ER diagram — SQL Server, 13 tables
- AdventureWorks ER diagram — SQL Server, 46 tables
- All examples · SQL to Mermaid