May 2019
Intermediate to advanced
600 pages
20h 46m
English
First, you need to consider that only simple views can be made to receive insertions, updates, and deletions easily. The SQL standard differentiates between views that are simple and updatable, and more complex views that cannot be expected to be updatable.
So, before we proceed, we need to understand what a simple updatable view is and what it is not. Let's start from the cust table:
postgres=# SELECT * FROM cust; customerid | firstname | lastname | age ------------+-----------+----------+----- 1 | Philip | Marlowe | 38 2 | Richard | Hannay | 42 3 | Holly | Martins | 25 4 | Harry | Palmer | 36 4 | Mark | Hall | 47(5 rows)
We will create a very simple view on top of it, such as the following:
CREATE VIEW cust_view ASSELECT ...
Read now
Unlock full access