Re: Grant SELECT/Execute to View/Function but not underlying Table

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Alex Magnum <magnum11200(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Grant SELECT/Execute to View/Function but not underlying Table
Date: 2015-09-24 11:49:58
Message-ID: CAKFQuwbPQo=3jM9PK6g1E=T31bWMc2t+V2Zax9bZcVmfSVv9ow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, September 24, 2015, Alex Magnum <magnum11200(at)gmail(dot)com> wrote:

> Hi,
> is it possible to grant select to views and functions without the need to
> also grant the user the SELECT privileges to the Tables used in the views
> or functions?
>
> That way I could create read only users on a website and limit their
> access to the bare minimum.
>
> Thanks in advance for any advise on this
>
> Alex
>

Views work this way by default. You can specify "security definer" to get
similar behavior when you create a function.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2015-09-24 11:50:15 Re: Grant SELECT/Execute to View/Function but not underlying Table
Previous Message Maxim Boguk 2015-09-24 11:47:18 Re: Grant SELECT/Execute to View/Function but not underlying Table