pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Can you make a simple view non-updatable?
Date: Fri, 8 Jun 2018 04:27:02 -0500
Message-ID: <9f42a43a-cb8d-a82c-05c5-fb0e30ec1a91@gmail.com> (raw)
In-Reply-To: <CAHeEsBeXjc9AUz7RPv6zBk=T9Or+1todyNzd5xdwyCjbhGKt7w@mail.gmail.com>
References: <CAHeEsBdFBLNLYZ-paRNzNXZLJ-4VHXWu3PfBqWN0z1yV12ibpw@mail.gmail.com>
<20180608110410.17103b1onzx4qrqc@www.gelassene-pferde.biz>
<CAHeEsBeXjc9AUz7RPv6zBk=T9Or+1todyNzd5xdwyCjbhGKt7w@mail.gmail.com>
On 06/08/2018 04:17 AM, Ryan Murphy wrote:
>
> 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.
Something like CREATE READ ONLY VIEW test_view2 AS SELECT ....
--
Angular momentum makes the world go 'round.
view thread (7+ messages) latest in thread
Message-ID: <9f42a43a-cb8d-a82c-05c5-fb0e30ec1a91@gmail.com> Permalink: ../9f42a43a-cb8d-a82c-05c5-fb0e30ec1a91@gmail.com/ Also on: postgresql.org/message-id/9f42a43a-cb8d-a82c-05c5-fb0e30ec1a91@gmail.com ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients from your mail client; the link fills in the headers below: reply via email Some clients, webmail especially, drop In-Reply-To and References from a link, and the reply then starts a new thread: use the mbox below. To: pgsql-general@postgresql.org Cc: ronljohnsonjr@gmail.com Subject: Re: Can you make a simple view non-updatable? In-Reply-To: <9f42a43a-cb8d-a82c-05c5-fb0e30ec1a91@gmail.com> References: <CAHeEsBdFBLNLYZ-paRNzNXZLJ-4VHXWu3PfBqWN0z1yV12ibpw@mail.gmail.com> <20180608110410.17103b1onzx4qrqc@www.gelassene-pferde.biz> <CAHeEsBeXjc9AUz7RPv6zBk=T9Or+1todyNzd5xdwyCjbhGKt7w@mail.gmail.com> <9f42a43a-cb8d-a82c-05c5-fb0e30ec1a91@gmail.com> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox