Skip to main content

Server-side for PostgreSQLs

Server-side programming means putting logic inside the database. PostgreSQL lets you write functions and procedures in PL/pgSQL, create triggers that fire on row changes, define views and materialised views, and use stored computation close to the data. It cuts network round trips but needs careful testing and version control.

Stage: Programming and Extensions · Part of the PostgreSQL roadmap · Last reviewed 19 November 2026

What to learn in Server-side

Server-side interview questions

What is the difference between a view and a materialised view?

A view stores only a query and runs it each time it is read. A materialised view stores the query result physically, so reads are fast but the data is stale until you run REFRESH MATERIALIZED VIEW.

When is a trigger a poor choice?

Triggers run invisibly, which can surprise developers, slow bulk writes, and make debugging hard. They suit audit logs and enforcing invariants, but business logic that changes often is usually clearer and easier to test in application code.

Where Server-side fits in the PostgreSQL roadmap

Server-side belongs to the Programming and Extensions stage (intermediate level). Extend the database.

Back to the full PostgreSQL roadmap