Triggers and updatable views

For views that are not automatically updatable, the trigger system can be used to make them updatable. The view seller_account_information, which shows the information about the seller account, is not automatically updatable, as shown next:

CREATE OR REPLACE VIEW seller_account_info AS SELECT account.account_id, first_name, last_name, email, password, seller_account_id, total_rank, number_of_advertisement, street_name, street_number, zip_code , cityFROM account INNER JOINseller_account ON (account.account_id = seller_account.account_id);

To verify that the view is not updatable:

car_portal=# SELECT is_insertable_into FROM information_schema.tables WHERE table_name = 'seller_account_info'; is_insertable_into  ...

Get Learning PostgreSQL 10 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.