Re: Can you make a simple view non-updatable? - Mailing list pgsql-general

From Ryan Murphy
Subject Re: Can you make a simple view non-updatable?
Date
Msg-id CAHeEsBeXjc9AUz7RPv6zBk=T9Or+1todyNzd5xdwyCjbhGKt7w@mail.gmail.com
Whole thread Raw
In response to Re: Can you make a simple view non-updatable?  (Thiemo Kellner <thiemo@gelassene-pferde.biz>)
Responses Re: Can you make a simple view non-updatable?  (Ron <ronljohnsonjr@gmail.com>)
Re: Can you make a simple view non-updatable?  ("Thiemo Kellner, NHC Barhufpflege"<thiemo.kellner@gelassene-pferde.biz>)
List pgsql-general

maybe it is time to overhaul the security concept.

I could see how I could revoke permissions from, say, all users that aren't superusers to INSERT or UPDATE certain views.  However, if possible it would be nice to get an error message about the VIEW not being updatable, rather than a user access error, which could be misleading.

When I try to insert into a non-updatable VIEWs, I get this message:

ERROR:  cannot insert into view "test_view"
DETAIL:  Views containing GROUP BY are not automatically updatable.
HINT:  To enable inserting into the view, provide an INSTEAD OF INSERT trigger or an unconditional ON INSERT DO INSTEAD rule.

It would be great to see something like this when trying to insert into a simple VIEW that I had made non-updatable:

ERROR:  cannot insert into view "test_view2"
DETAIL:  This view has manually been made non-updatable.

pgsql-general by date:

Previous
From: Thiemo Kellner
Date:
Subject: Re: Can you make a simple view non-updatable?
Next
From: Justin Clift
Date:
Subject: Re: Code of Conduct plan