Can you make a simple view non-updatable?

From: Ryan Murphy <ryanfmurphy(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Can you make a simple view non-updatable?
Date: 2018-06-08 08:38:01
Message-ID: CAHeEsBdFBLNLYZ-paRNzNXZLJ-4VHXWu3PfBqWN0z1yV12ibpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello.

I enjoy using VIEWs. Often my views are updatable, either automatically
(due to being a simple 1-table view, or due to a TRIGGER). Sometimes they
are meant to be just read-only.

Is there any way to set a VIEW to be read-only -- specifically, can I do
this for a view that is automatically updatable due to being simple?

The reason I want this: It will help me encode into my schema the
distinction between views that are supposed to behave like full-fledged
"subtypes" of a larger relation and need to be updatable, vs those that are
merely a report / literally just a "view".

Thanks!
Ryan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2018-06-08 08:46:57 Re: Code of Conduct plan
Previous Message Chris Travers 2018-06-08 06:27:00 Re: Code of Conduct plan