← All schemas
Schema Library

Pagila Database Schema Diagram

Pagila is the PostgreSQL port of MySQL's Sakila DVD-rental sample database, designed to showcase Postgres features. Films describe titles with a full-text search column; inventory holds physical copies per store; rentals link inventory to customers and staff; payments record each rental's charge. Sixteen tables are mapped above. Two details worth knowing: the payment table is range-partitioned by month in production (the monthly partitions are omitted here for readability), and the film table carries a film_embedding vector column plus a tsvector fulltext column - the Postgres-specific additions that distinguish Pagila from Sakila.

Last updated: 2026-09-27

Source: Pagila sample database, pagila-schema.sql (devrimgunduz/pagila) - a PostgreSQL port of MySQL's Sakila sample; the repository carries no license file, so check its terms before reuse

Tables
16
Core flow
Film -> Inventory -> Rental -> Payment
Origin
Sakila port for Postgres
Mini Map
Open in DBdiagramr to edit →

Tables in the Pagila schema

ColumnTypeNullableKey
customer
customer_idintegerNoPK
store_idintegerNo-
first_nametextNo-
last_nametextNo-
emailtextYes-
address_idintegerNo-
activeboolbooleanNo-
create_datedateNo-
last_updatetimestamp with time zoneYes-
activeintegerYes-
uuiduuidNo-
actor
actor_idintegerNoPK
first_nametextNo-
last_nametextNo-
last_updatetimestamp with time zoneNo-
category
category_idintegerNoPK
nametextNo-
last_updatetimestamp with time zoneNo-
film
film_idintegerNoPK
titletextNo-
descriptiontextYes-
release_yearpublic.yearYes-
language_idintegerNo-
original_language_idintegerYes-
rental_durationsmallintNo-
rental_ratenumeric(4,2)No-
lengthsmallintYes-
replacement_costnumeric(5,2)No-
ratingpublic.mpaa_ratingYes-
last_updatetimestamp with time zoneNo-
special_featurestext[]Yes-
fulltexttsvectorNo-
length_hoursnumeric(4,2) GENERATED ALWAYS AS (round(length / 60.0, 2)) VIRTUALYes-
film_actor
actor_idintegerNoPK
film_idintegerNoPK
last_updatetimestamp with time zoneNo-
film_category
film_idintegerNoPK
category_idintegerNoPK
last_updatetimestamp with time zoneNo-
film_embedding
film_idintegerNoPK
embeddingpublic.vector(20)No-
last_updatetimestamp with time zoneNo-
address
address_idintegerNoPK
addresstextNo-
address2textYes-
districttextNo-
city_idintegerNo-
postal_codetextYes-
phonetextNo-
last_updatetimestamp with time zoneNo-
city
city_idintegerNoPK
citytextNo-
country_idintegerNo-
last_updatetimestamp with time zoneNo-
country
country_idintegerNoPK
countrytextNo-
last_updatetimestamp with time zoneNo-
inventory
inventory_idintegerNoPK
film_idintegerNo-
store_idintegerNo-
last_updatetimestamp with time zoneNo-
language
language_idintegerNoPK
nametextNo-
last_updatetimestamp with time zoneNo-
payment
payment_idintegerNoPK
customer_idintegerNo-
staff_idintegerNo-
rental_idintegerNo-
amountnumeric(5,2)No-
payment_datetimestamp with time zoneNoPK
uuiduuidNo-
rental
rental_idintegerNoPK
rental_datetimestamp with time zoneNo-
inventory_idintegerNo-
customer_idintegerNo-
return_datetimestamp with time zoneYes-
staff_idintegerNo-
last_updatetimestamp with time zoneNo-
uuiduuidNo-
staff
staff_idintegerNoPK
first_nametextNo-
last_nametextNo-
address_idintegerNo-
emailtextYes-
store_idintegerNo-
activebooleanNo-
usernametextNo-
passwordtextYes-
last_updatetimestamp with time zoneNo-
picturebyteaYes-
store
store_idintegerNoPK
manager_staff_idintegerNo-
address_idintegerNo-
last_updatetimestamp with time zoneNo-

Frequently asked questions

What tables are in the Pagila database?

Pagila has 16 logical tables: actor, film, film_actor, film_category, film_embedding, category, language, inventory, store, staff, customer, address, city, country, rental, and payment - plus monthly payment partitions in production.

What is the difference between Pagila and Sakila?

Pagila is a port of MySQL's Sakila DVD-store sample to PostgreSQL with Postgres-native changes: boolean flags instead of char(1), real foreign keys, tsvector full-text search on film, a film_embedding vector column, and a range-partitioned payment table.

Why is there no payment partitions table in this diagram?

In production Pagila partitions payment by month (payment_p2022_01 and so on), which would add dozens of identical tables to the diagram. The payment table shown here carries the inherited foreign keys; the FAQ source file documents the full partitioned layout.

Explore more schemas

Visualize your own database

Paste your PostgreSQL connection string and get an interactive ER diagram of your own schema in under 10 seconds. No signup required.

Try it free →