Database Reference
In-Depth Information
For this, a unique index is required to exist on a materialized view. Now, executing a
SELECT command will bring the updated records:
warehouse_db=# SELECT warehouse_id, warehouse_name, city, state
FROM record.mat_view;
warehouse_id | warehouse_name | city | state
--------------+----------------+------------+-------
1 | Mark Corp | New London | CT
2 | Bill & Co | New London | CT
3 | West point | New London | CT
5 | South point | Avalon | LA
6 | Jackson & Co | Buffalo | NY
7 | GMC | Fulton | NY
8 | Ford | Elmira | NY
(7 rows)
Dropping a materialized view is pretty straightforward as we have done for tables
and views. This is done using the following statement:
warehouse_db=# DROP MATERIALIZED VIEW record.mat_view;
There is much to explore after learning the power of triggers and views.
This will work when you are actually playing with them and can work wonders
with regular practice.
Summary
Learning PostgreSQL concepts will surely help you advance your skillsets to a higher
level. After going through this chapter, you have acquainted yourself with the concepts
of triggers, rules, and views. You have learned the underlying concepts of their usage
and eficiency they bring along. Implementing triggers in native PostgreSQL languages
is a plus. You have got a glimpse of PostgreSQL rules as well. If you are passionate to
learn more, then the next topic that you will see is window functions.
 
Search WWH ::




Custom Search