- Refresh
pagila-data.sqlwith more diverse, less repetitive sample data:- Grow the customer base from 599 to 999, with signups spread across 2022-2026 instead of a single date
- Grow rental activity from ~16k to ~51.8k rows, and payments from ~16k to ~51k rows, spanning January 2022 through July 2026 instead of a few months in 2022
- Randomize
last_update/create_datetimestamps across all tables instead of reusing one fixed value per table
- Add 48 new monthly partitions to the
paymenttable inpagila-schema.sql(Aug 2022 - Jul 2026) to support the extended date range - Add
scripts/add_monthly_data.shto keep a running pagila instance current: creates the nextpaymentpartition and populates a month of new rental/payment activity, meant to be scheduled monthly - Rework the
actor_infoview to return a JSONB column (film titles grouped by category) instead of a concatenated text string, so it's a domain-relevant example for practicing JSONB operators (fixes #21) - Change
language.namefromcharacter(20)totext, and strip the trailing blank-padding it left in the shipped data, matching thetext-everywhere convention used by every other column (fixes #33) - Document PostgreSQL 17's SQL/JSON query functions (
JSON_EXISTS(),JSON_VALUE(),JSON_QUERY()),JSON_TABLE(), and the constructor functions (JSON(),JSON_SCALAR(),JSON_SERIALIZE()) in the README, with example queries verified againstactor_info - Raise the minimum supported PostgreSQL version to 18
- Bump
docker-compose.ymlto thepostgres:18image, and move thepgdatavolume mount from/var/lib/postgresql/datato/var/lib/postgresql— the 18+ images refuse to start with a volume mounted at the old path (see docker-library/postgres#1259); verified with a fulldocker compose up - Set
POSTGRES_DB: pagilaindocker-compose.yml(and fixrestore-pagila-data-jsonb.shto restore into it) sodocker-compose upactually loads data into apagiladatabase, matching the README's own\c pagilainstructions instead of silently loading everything into the defaultpostgresdatabase - Add a
uuidcolumn (DEFAULT uuidv7(), unique-indexed) tocustomer,rental, andpayment, demonstrating PostgreSQL 18's new UUID functions - Regenerate
pagila-insert-data.sqlfrom the same data aspagila-data.sql— it had drifted badly out of sync (e.g. every film'srelease_yearwas hardcoded to 2006 regardless of the real value), fixes #39 - Fix 400 of the 999 customers added in the 4.0.0 data refresh all being named "ELIZABETH HALL" — an uncorrelated scalar subquery in the name-generation script was evaluated once instead of per-row (the same bug class as the earlier
create_datefix); regenerated with proper per-row random names - Add a
Dockerfile(building pg_partman 5.5.0 from source onpostgres:18) and hand thepaymenttable's future partitions over to it instead of creating them by hand, while leaving the existing Jan 2022 - Jul 2026 partitions untouched; maintenance runs viascripts/run_partman_maintenance.shon cron (partman.run_maintenance_proc(0, true, true)) rather than pg_partman's own background worker, andscripts/add_monthly_data.shcalls the same procedure as a safety net