Module 08 of 10

Views, Functions & Triggers

Lessons

About This Module

As your database grows, you'll want to stop repeating yourself. Instead of rewriting the same query or the same logic over and over, you can save it inside PostgreSQL and reuse it. This module covers the main tools for doing that.

You'll start with views and materialized views, which save a query so you can treat its result like a table. Then you'll write functions and stored procedures to package logic you can call whenever you need it, and learn how the two differ. Finally, you'll use triggers to run a function automatically when data is inserted, updated, or deleted.

With these tools you'll be ready for the next module, Security & Administration, where you learn how to control who can do what in your database.

Lessons

3 videos
01

Postgres Views and Materialized Views with Examples

A short tutorial explaining what views and materialized views are in Postgres, how they differ, and how to create each one.

02

PostgreSQL Functions Explained: Create, Call & Manage Functions

A look at functions in PostgreSQL, a powerful feature for data manipulation and business logic. Learn how to create, call, and manage them.

03

PostgreSQL Stored Procedures Explained

A deeper look at stored procedures in PostgreSQL, including how they differ from functions and when to use each one.