Revitalizing Outdated Data Models with PostgreSQL Views
summary
Claims that PostgreSQL Views can modernize a messy polymorphic schema without migrations, using only views plus optional triggers and parameters. Demonstrates creating a chicken_in_large_barn view that renames animal_id and barn_id to chicken_id and large_barn_id, shows that simple views are automatically updatable when they meet PostgreSQL’s rules, and adds a trigger function that hardcodes types on insert so nulls never occur. Recommends WITH CHECK OPTION and security_invoker for integrity and access control.
AI-written summary · about
chapters (8)
- 0:00Intro
- 2:06Case Study
- 6:31What is a PostgreSQL View?
- 8:16Creating a view
- 11:49Updatable views
- 14:00Using triggers to augment updates
- 19:07Useful parameters
- 21:43Views vs Materialized Views
related talks
49mSELECT 'amazing features' FROM "postgresql"
01h 09mReplacing Oracle Features in PostgreSQL: HA, Functions & Extensibility
46mBeyond Good and ORMs
48mAdvanced Postgres Schema Design (For Scalable Application Development) bySehrope Sarkuni
45mSELECT 'amazing_features' FROM "postgresql"
30mPuny to Powerful PostgreSQL Rails Apps
34mSimple and Awesome Database Tricks
25mData modeling with PostgreSQL at the core of Software Development
