This section is about how PostgreSQL makes a view reference disappear. When a user writes SELECT * FROM my_view , the planner no longer sees my_view in that query. As soon as PostgreSQL receives the query, it moves the SELECT definition that the view name points to into that spot. Where and how that substitution happens, and how the fact that the mechanism rides on PostgreSQL's old RULE system surfaces in application code, is the subject of this section. View and materialized view: what is the difference Views themselves are worth one paragraph of setup. PostgreSQL has two kinds of views: the plain view and the materialized view. A plain view holds no data. A view definition is a SELECT line (or a larger query), and every time you SELECT from the view, you get back the result of running that definition SELECT freshly. The view itself has no storage. Only the view definition is registered in the catalog, and each time a query comes in, that definition gets expanded to read data from the base tables.…